Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
965
UltraGridGroup and Column Chooser
posted

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;
					
Parents
No Data
Reply
  • 23930
    Verified Answer
    Offline posted

    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.

    WG_HideGroupHeaderWhenNoColumnsAreVisible.zip
Children