GridView context menu not working with header been a textblock

2 posts, 0 answers
  1. Lax
    Lax avatar
    15 posts
    Member since:
    Mar 2015

    Posted 23 Mar 2015 Link to this post


    I have followed this post from Telerik documentation to show context menu on the radgrid to choose columns of the grid.

    But, as we need to wrap header text, we are using textblock for it like  below, due to which header text and the context menu items are not in sync. And so, I have ended up writing code in the radcontextmenu events in the code behind file to manually chose columns etc. Just wondering if there is a xaml way to achieve the same even when header text is placed inside a textblock or am I missing anything here?

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Balance, StringFormat=N0}" TextAlignment="Right" >
                                <TextBlock Text="Balance prior deductions" TextWrapping="Wrap" Width="100px"/>

  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 26 Mar 2015 Link to this post


    The Header is an object. As MenuItem's Header is bound to column's header, you can specify a converter for the binding and dig to find the value you would like to populate.


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top