Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Grid Tech Support » Programatically setting Groupby Collapse All
Subject Author Date
Nachiket Mehta May 22, 2007 - 3:49 PM

I am currently evaluating ElegantGrid. I want to know if it is possible not to show the GroupByBox and set the grouping in my code. Also, can I hide the columns that I am setting GroupBy for? It is taking unnecessary space by displaying a column whose value is displayed by the grouping node on top and repeating the same value for each row. Thanks.

Technical Support May 23, 2007 - 8:28 AM

You can show or hide the Group By Box using the GroupByBoxVisible property. You can hide a column by setting Column.Visible to true. Here is how the grouping and sorting works. There is a SortRules collection that specifies the columns by which the grid can be grouped and sorted. There is a SortGroupCount property that tells the grid by how many columns from the SortRules collection the grid should be sorted. For instance, you have two columns in this collection and you set SortGroupCount to 1. This means the grid will be grouped by one column (the first column in the collection). You can play with all these properties in the Visual Studio designer. So all features you are asking about requested work.

Nachiket Mehta May 23, 2007 - 10:59 AM

Thanks for a quick response. I went through most of the properties of ElegantGrid and everything is self explanatory. I just have 2 more questions for you.

1. AllowDraggingOffColumns property allows whether the end-user can hide columns by dragging header cells out of the header.
How can they make them visible again?

2. How can rows auto-size to fit content in height? This is shown in your sample demos project in the Search section. However, how does this grid auto-size the row height to fit the content? I have ColumnAutoSizeMode set to Fill. Anything else I am missing?

Thanks for all the help.

Technical Support May 24, 2007 - 4:46 AM

You can make the columns visible again by setting the Column.Visible property to true.

As for your second question, cells measure their height by content automatically. Still if you want to make the cell height fixed, please use the CellStyle.FixedHeight property. In the Search demo, we did this by using a custom cell content viewer.

Nachiket Mehta May 24, 2007 - 10:02 AM

So if I understood you correctly, If I have a Text column with width defined as 50 and have text that goes beyond the defined width, the height of that row will adjust automatically to fit content of this cell? I cannot replicate this behavior. Do I have to implement customer cell content viewer to achieve this? VS Datagridview has a property called AutoSizeRowMode and when you set it to AllCells all rows change their heights automatically depending on the content. Thanks.