Hello !
I'm using a custom hierarchy on a RadGridView as defined below :
In order to hide the Expand/Collapse Hierarchy button on several rows, I'm using the following method :
I'm using a custom hierarchy on a RadGridView as defined below :
<
telerik:RadGridView
x:Name
=
"rgvAttributes"
AutoGenerateColumns
=
"False"
CanUserDeleteRows
=
"False"
IsReadOnlyBinding
=
"{Binding IsEditAttributesGrid,Mode=TwoWay}"
ItemsSource
=
"{Binding ListEntries}"
SelectedItem
=
"{Binding SelectedAttribute, Mode=TwoWay}"
SelectionMode
=
"Single"
>
<
i:Interaction.Behaviors
>
<
helper:IsExpandableBehavior
IsExpandableSourcePropertyName
=
"IsExpandable"
/>
</
i:Interaction.Behaviors
>
<
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:GridViewTableDefinition
/>
</
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:RadGridView.Columns
>
[...]
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
Control:ContentStepVisualizer
/>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
</
telerik:RadGridView
>
In order to hide the Expand/Collapse Hierarchy button on several rows, I'm using the following method :
- As the name explains, the simple behavior "IsExpandableBehavior" is used to bind the "IsExpandable" property of each GridViewRow to the corresponding object property of the ObservableCollection<Attribute> ListEntries in my ViewModel,
- Setting the "IsExpandable" property of one of the Attribute object to False correctly hide the Expand/Collapse Hierarchy button of the corresponding row in the RadGridView.
When calling ExpandAllHierarchyItems() on the RadGridView, every hidden Expand/Collapse Hierarchy buttons appears back and every row expands.
It seems that the ExpandAllHierarchyItems() of RadGridView methods doesn't consider the state of the "IsExpandable" property before expanding a GridViewRow.
Is this the desired behavior or I have done something wrong provoking it ?
Many thanks for your help !
TheFlo