Hello Telerik,
I wanted to implement a column chooser for a grid. Then I followed this doc here
http://docs.telerik.com/devtools/wpf/controls/radgridview/features/overview-controlpanel
and found out that I basically just need to add this piece of code inside my grid to achieve the desired feature.
<
telerik:RadGridView.ControlPanelItems
>
<
telerik:ControlPanelItem
ButtonTooltip
=
"Column chooser"
>
<
telerik:ControlPanelItem.Content
>
<
ListBox
ItemsSource
=
"{Binding Columns}"
BorderThickness
=
"0"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
CheckBox
Content
=
"{Binding Header, Mode=OneWay}"
IsChecked
=
"{Binding IsVisible, Mode=TwoWay}"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
</
telerik:ControlPanelItem.Content
>
</
telerik:ControlPanelItem
>
</
telerik:RadGridView.ControlPanelItems
>
Now my question is:
Is there a way I can reuse this block of code in several grids? Such as via usercontrols?
I just want to keep my code clean.
please show me the way.
Thank you!