User (Old forums)MemberMay 23, 2008 at 6:03 amPost count: 23064
I wonder if it is possible to change the default text for the header row? Currently, the header row shows the title and value of the column by which the grid is grouped, and the number of items belonging to that group. Can I change the text to something different?
Imported from legacy forums. Posted by Sop (had 1231 views)Xceed SupportMemberMay 23, 2008 at 2:06 pmPost count: 5658User (Old forums)MemberMay 25, 2008 at 10:05 pmPost count: 23064
I’m still not sure how to do it. Can you please give an example?
Imported from legacy forums. Posted by Sop (had 617 views)User (Old forums)MemberMay 26, 2008 at 2:36 pmPost count: 23064
Access the TitleFormat property on the GroupManagerRow. You can do it in the designer if you create your group at design time, or through code if you create your group at run time.
Group countryGroup = new Group( “Country” );
( ( GroupManagerRow )countryGroup.HeaderRows[ 0 ] ).TitleFormat = “%ColumnTitle% : %GroupTitle% – %DataRowCount% item(s)”;
gridControl1.GroupTemplates.Add( countryGroup );
The first HeaderRow of the group is the GroupManagerRow,
where you find the title of the group.
Imported from legacy forums. Posted by André (had 728 views)User (Old forums)MemberJuly 25, 2008 at 5:53 amPost count: 23064
Thank you for the example. I can successfully change the text if I have the grouping created beforehand. However, I am still not sure how to change the text if I don’t have the group created. ie. I drag a column header to the top of the grid where I can create a grouping from there. In this case, I don’t have any group created in my code nor in the designer. How can I change the format of the text in this case?
Thanks for your help.
Imported from legacy forums. Posted by Sop (had 841 views)User (Old forums)MemberAugust 5, 2008 at 10:06 amPost count: 23064
Simply use the GroupAdded event, and do the same as above in the event handler.
private void Form1_Load( object sender, EventArgs e )
new GroupAddedEventHandler( gridControl1_GroupAdded );
void gridControl1_GroupAdded( object sender, GroupAddedEventArgs e )
GroupManagerRow )e.Group.HeaderRows[ 0 ] ).TitleFormat = “%ColumnTitle% : %GroupTitle% – %DataRowCount% item(s)”;
Imported from legacy forums. Posted by André (had 981 views)
- You must be logged in to reply to this topic.