This is a migrated thread and some comments may be shown as answers.

Hiding columns based on a certain selected value

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Farhan
Top achievements
Rank 1
Farhan asked on 17 Mar 2011, 01:11 AM
Hi,

I am developing a hierarchical data grid where by the values of the parent row can show/hide certain columns. I did setup a bindable value from the parent row's object  to the IsVisible property of the GridViewDataColumn but the binding never gets invoked even though all conditions are met correctly. How do I go about achieving this?

Thanks,
Farhan

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 18 Mar 2011, 10:58 AM
Hello Farhan,

You do the following:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Country}"
        IsVisible="{Binding DataContext.IsVisibleProperty, RelativeSource={RelativeSource AncestorType=telerik:RadGridView}}"/>

In this case IsVisibleProperty is a property of the parent item. Still, I am sending you a sample project that you may use for testing the solution immediately.


Regards,
Maya
the Telerik team
Tags
GridView
Asked by
Farhan
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or