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 Maria,
Thanks for the update.
Is this considered a bug? Since it sounds like Visibility bindings will be broken in this scenario. If so when is it likely to be fixed?
If not does this mean XamGrid will not fully support column Visibility bindings when using GroupColumns?
Eno,
GroupColumn Visibility property is set to collapsed when there is no child column to be displayed so that the GroupColumn is not visible either. It is design behavior and it is not considered as a bug. What you could do in this case is applying custom logic and check the visibility of the group column when the checkboxes are checked/unchecked.
The issue isn't that the GroupColumn Visiblity is collapsed when there is no child column. The issue is that after it becomes colapsed it no longer reappears. In addition to this the GroupColumn and ChildColumn Visibility bindings are broken.
Could you check that the GroupColumn not reappearing and breaking bindings is really a design behavior?
Thanks
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.
Here is a modification of the example above which shows the bindings being broken after the GroupColumn is automatically collapsed:
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; }
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.
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.