User (Old forums)MemberMarch 14, 2008 at 7:07 pmPost count: 23064
What’s the proper way to set the order groups should be displayed? I tried using the level property, since it looks like an index, but it’s read only. Tried to reorder the Groups array, but it can’t be done either.
Imported from legacy forums. Posted by Testing (had 3626 views)User (Old forums)MemberMarch 14, 2008 at 7:10 pmPost count: 23064
To elaborate on what I’m trying to do is to have always a specific group on top and another at the bottom, with all the other groups generated by the system in the middle. Like a header group and footer group. Under certain circumstances , rows that belongs to groups that are in the middle will be moved to either the bottom or top one.
Imported from legacy forums. Posted by Testing (had 427 views)Xceed SupportMemberMarch 18, 2008 at 5:16 pmPost count: 5658
You could use the <a href=”http://doc.xceedsoft.com/products/Xceedgrid/Custom_Sorting.html”> custom sorting</a> to pre-decide which group is going to be on top by explicitly calling a sort on the specific column and preventing the user from re-sorting after.
The following code will always show the group with the “2” value on top and the “3” value at the bottom:
for( int j = 0; j < 4; j++ )
Column col = new Column( “Column”+j.ToString(), typeof(int) );
gridControl1.Columns.Add( col );
gridControl1.Columns[ 0 ].DataComparer = new SpecialComparer();
for( int i = 0; i < 20; i++ )
Xceed.Grid.DataRow row = gridControl1.DataRows.AddNew();
foreach( Cell cell in row.Cells )
cell.Value = i % 5;
Group group = new Group( “Column0” );
gridControl1.GroupTemplates.Add( group );
gridControl1.Columns[ 0 ].SortDirection = SortDirection.Ascending;
( ( ColumnManagerRow )gridControl1.FixedHeaderRows[ 1 ] ).AllowSort = false;
( ( GroupByRow )gridControl1.FixedHeaderRows[ 0 ] ).AllowGroupingModification = false;
Imported from legacy forums. Posted by CharlesB (had 513 views)User (Old forums)MemberApril 2, 2008 at 6:53 pmPost count: 23064
Thank you very much for the information. It was very helpful and it’s doing what I wanted it to do now, however, I have another question.
It seems like everytime the UpdateGrouping() is called, the grid resets the entire grid, scrolling back to the top of it and selecting the first row, deselecting anything that might be selected. Is there a setting to prevent that behavior.
Imported from legacy forums. Posted by Testing (had 441 views)Xceed SupportMemberApril 3, 2008 at 2:45 pmPost count: 5658
No, this is a built-in behavior (by design). To work-around this behavior, you can keep a list of the Selected DataRows before the UpdateGrouping is called and subscribe to the Application.Idle event. In the event, (first, you unsubscribe from it) you re-add the selection.
Imported from legacy forums. Posted by CharlesB (had 4771 views)
- You must be logged in to reply to this topic.