I'm having issues with getting the IsExpandable property to be respected. Basically when my "Parent" has no children, I don't want the expand togglebutton to be shown. Below is some sample xaml that I am using. The resulting grid has the details column fully populated with the togglebuttons when there should be at least one without the button. I've stepped through my StyleSelector code and it is returning the proper style. But it doesn't appear to have any affect. What am I doing wrong?
<
UserControl
...>
<
UserControl.Resources
>
<
Style
x:Key
=
"NoChildrenRowStyle"
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"IsExpandable"
Value
=
"False"
/>
</
Style
>
<
Style
x:Key
=
"HasChildrenRowStyle"
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"IsExpandable"
Value
=
"True"
/>
</
Style
>
</
UserControl.Resources
>
<
local:RowStyleSelector
x:Key
=
"RowStyleSelector"
NoChildrenStyle
=
"{StaticResource NoChildrenRowStyle}"
HasChildrenStyle
=
"{StaticResource HasChildrenRowStyle}"
/>
<
telerik:RadGridView
ItemsSource
=
"{Binding ParentsCollectionView}"
RowIndicatorVisibility
=
"Collapsed"
AutoGenerateColumns
=
"False"
RowStyleSelector
=
"{StaticResource RowStyleSelector}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
/>
<
telerik:GridViewDataColumn
Header
=
"Name"
DataMemberBinding
=
"{Binding Name}"
/>
<
telerik:GridViewDataColumn
Header
=
"Age"
DatatMemberBinding
=
"{Binding Age}"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<
ListBox
ItemsSource
=
"{Binding Children}"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
Grid
>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
Grid
>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
</
telerik:RadGridView
>
</
UserControl
>