I am new to DevExpress and I couldn't find a solution to modify the plus sign on nested gridviews.
Since some of my users have tablets they want to expand rows by touching the plus sign. However they are having hard times to touch exactly on the plus sign.
Is there any way to modify it to make it larger?
Changing size of the sign or changing the image completely is pretty fine for me.
Your ideas are welcome.
I suggest you to go through below reference links, These will provide you more details regarding your desired functionality:
To modifying Group Expand Button:
How to display an image in a group row
GridView.CustomDrawGroupRow Event
How to get skin's '+' icon for Custom Draw Group Rows
In case of Mater-Details:
For increasing the size of the Expand/collapse button:
Enlarge Exapnd/Collapse button of master detail view in xtragrid
master detail expand button size
If you want to change GridView's expand\collapse icon then you can
change it by modifying an image of the Grid | PlusMinusEx skin
element. Here is a code snippet illustrating how to replace the image
with your custom one in a currently applied skin.
Skin skin = GridSkins.GetSkin(DevExpress.LookAndFeel.UserLookAndFeel.Default);
SkinElement element = skin[GridSkins.SkinPlusMinusEx];
element.Image.SetImage(GetNewImage(), Color.Magenta);
LookAndFeelHelper.ForceDefaultLookAndFeelChanged();
You can also paint the expand/collapse button on the CustomDrawCell
event handler. Please see the How to paint the master row's expand
buttons within the CustomDrawCell event in exactly the same manner
as the XtraGrid does KB article for more information.
References:
Draw custom expand/collapse button in GridView Row
Custom Draw +/- button for Master Detail GridView
Grid - How to change the master-detail expand button
XtraGrid:Adding a button to a cell that will allow cell data to expand - collapse.
Alternatively, you could use the TouchUIMode feature which make thing bigger and easier to use in a touch enabled environment. See this page :
https://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsWindowsFormsSettings_TouchUIModetopic
Edit : there is also a touch optimized skin which you can see in this blog post :
https://community.devexpress.com/blogs/theonewith/archive/2011/12/29/build-for-beautiful-with-dxv2-metro-inspired-winforms-apps.aspx
Related
I use DevExpress
I had difficulty managing. I have a GridControl and added cell navigation buttons. That's just the question, how can you implement this code?
There are 4 buttons, among which are: First entry (|<), Previous entry (<), Next entry (>), Last entry (>|). How can you programmatically write these cell movements?
An example of an Access screen, such as this navigation:
My suggestion would be to not write it yourself... use the Dev Express embedded navigator.
If you go to designer view on the grid, go to Feature Browser, Focus, Embedded Navigator and set the UseEmbeddedNavigator property to true.
You can, of course, also do this in the regular property window of your form.
Once you do that, your grid will have it:
To be clear I'm talking about Grid - not GridView or DataGrid or anything like that.
All I found online was about GridView and such.
I want to be able to select items with a mouse click or drag from a Grid.
What I have is a table filled with text implemented through a Grid. I want to be able to select "cells" in the Grid.
The reason I don't use DataGrid is because I couldn't find a way to set a cell's span.
Thank you,
Dolev.
I had nearly the same approach some month ago: Dynamic ui with rows and columns
Maybe this will help you.
In the end I used Selector.IsSelected attached property.
Selector Class
I modified the MouseDown, MouseUp, MouseMove event to record a rectangle created when dragging the mouse while the left button is held. Then I checked which cells are within that rectangle.
As a double check to see that the cell is really selected I used Selector.SetIsSelected and Selector.GetIsSelected.
I am currently working on a project that displays user data in a grid, each user has a total and when clicked expands out to show the sub items that make up that total and they can be expanded again to show even more details.
I currently achieve this by using a DataGridView with its data bound to a DataTable, I hide the sub items for each user in the "RowsAdded" event and then just show/hide them as the main user lines/sub lines are clicked.
The Main problem with this is the scroll bar jumps a lot when data is changed and I require it to only move when the user wants it to.
I also have a requirement that no line must ever be covered and the parent lines should show totals of the values in the child (I can do this part manually the more important part is that its not a grouping like with a outlook style list).
My question is: Is there a better way to have expanding entries in a table format? And if hiding and un-hiding is the only way then any idea how to fix the scrolling problem?
I have tried hiding and showing lines as I have already said and I have also tried hiding and showing another Control (in this case another DataGridView) the problem with this approach is that it covers the other rows as I have yet to find a suable way to pad out a space for the control to be in.
You can use the following code to eliminate the scrolling animation.
dataGridView1.ScrollBars = ScrollBars.None;
// Do your show/hide on your datagridview rows
dataGridView1.ScrollBars = ScrollBars.Both;
In the End there was no satisfactory way to do this with winforms so I was forced to swap to WPF and I had everything running in about 2 hours.
My end solution was to use a DataGrid with rowdetails that contain a DataGrid.
I have a data grid displaying results from a sql database. What I want to do is make it so that when I double click on a cell in the datagrid, a new window appears where that cell can be edited. I also would like to have all the info for that cell to be autogenerated into editable fields when the cell is double clicked. Any help or links to tutorials is appreciated. Thanks.
Try this DataGridView.CellDoubleClick Event
Did you consider using data binding? Simply put, you can bind your items list to DataGrid, and current item (eg. selected/double clicked) to your edit form's controls (TextBox, Label and whatever else you might have there).
Here are good starting points for windows forms: #1, #2. They cover problem you're facing. You can find data binding tutorials for ASP/WPF easily too, but especially first link covers entire concept pretty well.
I have a datepicker control that I am using to set a date field in a gridview control, my datepicker shows a date and a button to display a calendar you can use to pick a date. This works great on its own but when I add this to a gridview the calendar pops up and the columns and rows cover up parts of the calendar. Setting the ZIndex for the calendar doesn't help because the other rows are on different panels? How can I get around this? I tried raising the ZIndex of the VisualParent but no luck.
Update, the gridview is very standard, 4 columns one of which is a date column, the datatemplate for that column creates a datepicker which initially looks like a text box and a button, the button is placed on a canvas panel and when clicked a calendar is added to the canvas. The canvas is the only panel that allows its children to stretch over its own boundaries so the button is 10 x 10 or so and the calendar is 200 x 200. When the calendar pops up it normally just covers up adjacent fields but when placed on a gridview each cell of the gridview that is "after" the datepicker covers up the calendar. I'm supposing I need to raise the zindex of my cell but I can't find a way to do this?
Could you provide more info about gridview and datepicker? Especially are they your custom controls or do they belong to any open source or commercial libraries or separate?
You also mentioned that DataTemplate has Canvas as a panel. Even though a Canvas can contain large elements, it does not necessarily show all of its children. This may or may not relate to your problem, though.
P.S. Sorry I had to post this as an answer. My reputation does not allow me to comment?
Wow, this should be done using a popup or an expander.