Reusable ControlPanelItems?

3 posts, 1 answers
  1. Vitor
    Vitor avatar
    53 posts
    Member since:
    Mar 2016

    Posted 16 Mar 2016 Link to this post

    Hello Telerik,


    I wanted to implement a column chooser for a grid. Then I followed this doc here

    and found out that I basically just need to add this piece of code inside my grid to achieve the desired feature.

        <telerik:ControlPanelItem ButtonTooltip="Column chooser">
                <ListBox ItemsSource="{Binding Columns}" BorderThickness="0">
                            <CheckBox Content="{Binding Header, Mode=OneWay}" IsChecked="{Binding IsVisible, Mode=TwoWay}" />



    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!

  2. Answer
    Martin avatar
    160 posts

    Posted 21 Mar 2016 Link to this post

    Hello Vitor,

     In order to reach the desired behavior, you may choose between two approaches. The first one is to Implicitly Set the Control Panel Items which is our recommended approach. The second one
    is to Explicitly Set the Control Panel Items. Both approaches allow the code to be defined only in one place and many grids to reuse it.

    I hope that this helps. Should you have any other questions, do not hesitate to contact us.

    Martin Vatev
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. Vitor
    Vitor avatar
    53 posts
    Member since:
    Mar 2016

    Posted 21 Mar 2016 in reply to Martin Link to this post

    Thank you! That is exactly what I was looking for!!!

Back to Top