This is a migrated thread and some comments may be shown as answers.

Retrive controls into data template of custom column

2 Answers 22 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dario
Top achievements
Rank 2
Dario asked on 03 Aug 2012, 09:54 AM
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 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Aug 2012, 06:04 AM
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.

0
Dario
Top achievements
Rank 2
answered on 06 Aug 2012, 11:09 AM
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.
Tags
GridView
Asked by
Dario
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Dario
Top achievements
Rank 2
Share this question
or