Hello,
I am using Infragistics 15.1 and have a grid in which I create UltraGridGroups and have a column chooser on the grid. I can hide/unhide columns, however when I hide the last column in a group I'd like the group header column to also hide. For example Group2 would be hidden when Column3 and Column4 are hidden and the group header would reappear if Column3 or Column4 was made visible again. What would be the preferred method to accomplish this functionality?
Sample code to create UltraGridGroups
UltraGridBand band = ugGrid.DisplayLayout.Bands[0];
band.RowLayoutStyle = RowLayoutStyle.GroupLayout;
UltraGridGroup ultraGridGroup1 = band.Groups.Add( "Group1", "Group 1" );
UltraGridGroup ultraGridGroup2 = band.Groups.Add( "Group2", "Group 2" );
band.Columns["Column1"].RowLayoutColumnInfo.ParentGroup = ultraGridGroup1 band.Columns["Column2"].RowLayoutColumnInfo.ParentGroup = ultraGridGroup1;
band.Columns["Column3"].RowLayoutColumnInfo.ParentGroup = ultraGridGroup2; band.Columns["Column4"].RowLayoutColumnInfo.ParentGroup = ultraGridGroup2;
This is perfect and exactly what I was looking for. Thanks for the help!
Hi,
Thank you for posting in our forums.
You can use the AfterColPosChanged event (it also fires when a column is hidden) to see if there is a group with no visible columns or to see if a previous hidden group must now be shown. This way you can ensure that a group will not be shown if it has no columns.
I have attached a sample in order to demonstrate this suggestion.
Please let me know if you have any additional questions.