When using GroupColumns in XamGrid if the Visbility of Columns within a GroupColumn become Colapsed the GroupColumn will also become colasped. This is the behaviour expected however once the GroupColumn has become colapsed even when the Columns within that GroupColumn become Visible again the GroupColumn will never become Visible again.
Here is an example:
Xaml:
Hello,
Thank you for posting!
I have logged this behavior in our tracking system, with an issue ID of 140936. I have linked the development issue to your case CAS-115164-M1M8K6 so that you are automatically updated regarding any updates on it when our development team review it.
Hello Eno,
Our development team had reviewed this issue and stated that this is the design behavior of the control. When the Visibility property of the last visible child of a GroupColumn is set to Collapsed, actually the visibility of the GroupColumn is changed to collapsed. The visibility of the child column stays visible. This is the reason that does not allow the columns to be displayed after checking the checkboxes again. What I could suggest you is including some custom logic to check whether the visibility property of the group column is set to collapsed when it should be visible (A or B checkboxes are checked).
More information regarding the group columns and their visibility could be found in our online documentation: http://help.infragistics.com/Help/NetAdvantage/Silverlight/2013.1/CLR4.0/html/xamGrid_Group_Column.html
Hi,
The Visibility property of the last visible column is not changed to collapsed. Instead the GroupColumn is collapsed as it is explained in our documentation:
“If your end user tries to hide the last visible column of a GroupColumn, that particular column won’t hide, instead that GroupColumn will hide. For example, based on the above code snippet, if your end user has ProductID hidden, and then tries to hide ProductName, then the entire Product Information group will hide.”
In the attached sample the each TextColumn is bound to IsChecked property of a CheckBox but the visibility of the GroupColumn is not bound to any converter or property. When its value is changed automatically there is no functionality for setting it to visible again. If you bin dthe GroupColumn the same way the TextColumn “A” is bound, its visibility would be changed associated with the value of the IsChecked property of CheckBox “A”. This means that the binding functionality is working correctly.
Hi Maria,
Here is a modification of the example above which shows the bindings being broken after the GroupColumn is automatically collapsed:
Thank you for the detail you had provided and I am sorry for the delay. I have created a sample project where the Visibility of the Group column is changed to Visible according to the number of its visible children columns. This could be achieved by calling the ColumnVisibilityChanged method of the grid when a checkbox is checked. When this event is called I check if the group column is collapsed and if it is, its Visibility property is set to Collapsed. I hope that this will help you in resolving the issue. Please feel free to ask if you have any questions.
Hi Eno,
I am just checking if my last reply was helpful for you. If you have any other questions on column visibility, please feel free to let me know.
Thanks for following this up Maria. I can confirm that the solution you provided works.
To summarise for anyone else interested in how to work around this - you need to hook into ColumnVisibilityChanged event on XamGrid with the the following handler:
private void OnColumnVisibilityChanged(object sender, ColumnVisibilityChangedEventArgs e) { GroupColumn.Visibility = Visibility.Visible; }