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
1425
Collapsing a Feild based on when another field is collaped when grouped.
posted

Hi,

My situation is that for displaying fields in XamDataGrid, I have AutoGenerateFields="True" and then I collapse the fields in FieldLayoutInitialized event which I don't need. And then also in FieldLayoutInitialized event I have also set CellVisibilityWhenGrouped = Visibility.Collapsed with one of the field (lets call this field A ). I am also displaying another field (lets call this field B in the same column as field A but in 2nd row having field A in first row.)

Now what I want to do is since field A's CellVisibilityWhenGrouped = Visibility.Collapsed, its collapsed when grouped but field B in same column still remains visible. How can I make field B collapsed as well when field A is collapsed when its grouped.

I tried binding field B's Visibility with field A's Visibility but it didn't work.

                Binding bin = new Binding();
                bin.Source = layout.Fields["A"];
                bin.Path = new PropertyPath("Visibility");
                BindingOperations.SetBinding(layout.Fields["B"], Field.VisibilityProperty, bin);

Your help will be much appreciated.

Thanks,

Imad.

 

Parents Reply Children