I am having a grid inside a grid scenario, I am going to show code for hierarchical template, which is cut to essential parts (and showing only two columns):
This grid is binded to a collection of items, which is a property on the entiy from the main grid (remember this is a grid inside hierarchical template). Each item has a property Type. Based on the type I am painting the row using RowStyleSelector. So far no problems. Now I need to have different cell style / template based on the item Type.
Item name: Speed: Output:
Item 1 50 1000 Type.A
Item 2 300 Type.B
Item 3 25 600 Type.A
As you can see, I do not want even show the value for Speed column for Type.B (currently it is showing 0). Also, Speed column is editable for TypeA items, should not be for Type.B items
What is the cleanest / best way to achieve this?
Regards,
Goran
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
telerik:RadGridView
AutoGenerateColumns="False"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding Items}"
RowStyleSelector="{StaticResource CycleActivityProductRowStyleSelector}">
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Speed}"
Header
=
"Speed"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Output}"
Header
=
"{Binding Output}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
This grid is binded to a collection of items, which is a property on the entiy from the main grid (remember this is a grid inside hierarchical template). Each item has a property Type. Based on the type I am painting the row using RowStyleSelector. So far no problems. Now I need to have different cell style / template based on the item Type.
Item name: Speed: Output:
Item 1 50 1000 Type.A
Item 2 300 Type.B
Item 3 25 600 Type.A
As you can see, I do not want even show the value for Speed column for Type.B (currently it is showing 0). Also, Speed column is editable for TypeA items, should not be for Type.B items
What is the cleanest / best way to achieve this?
Regards,
Goran