Retrive controls into data template of custom column

3 posts, 0 answers
  1. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 03 Aug 2012 Link to this post

    Hi to all,
    I have this xaml code, I need to "found" RadMenuItem  object by RadGridView control, because I need to change RadMenuItem.Header by code.
    How can i do to find it?


    <telerik:RadGridView.Columns>
      <telerik:GridViewDataColumn Width="Auto">
        <telerik:GridViewDataColumn.CellTemplate>
          <DataTemplate>
            <telerik:RadButton Content="Menu">
              <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu  EventName="Click">
                  <telerik:RadMenuItem Header="Scheda" x:Name="Funzioni_ActionPlan_SchedaRadMenuItem" Click="Funzioni_ActionPlan_SchedaRadMenuItem_Click" Tag="{Binding}"/>
                  <telerik:RadMenuItem Header="Modifica" x:Name="Funzioni_ActionPlan_ModificaRadMenuItem" Click="Funzioni_ActionPlan_ModificaRadMenuItem_Click" Tag="{Binding}"/>
                </telerik:RadContextMenu>
              </telerik:RadContextMenu.ContextMenu>
            </telerik:RadButton>
    .....
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 06 Aug 2012 Link to this post

    Hello,

     I'm afraid you cannot do that. Can you post more info about your scenario? Why not use MVVM to achieve your goal? 

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 06 Aug 2012 Link to this post

    I done this solution:

    I changed this control
    <telerik:RadButton Content="Menù">
     in this new version control
    <telerik:RadButton Content="{Binding Converter={StaticResource TranslateBaseConverter}, ConverterParameter='CurrentContextOfView|CurrentKey'}">

    In TranslateBaseConverter I write the logic of traduction.
    In ConverterParameter I set my "route" to retrieve the correct traduction.
Back to Top