Hi I have an datatemplate which i have created for my raddataform, the problem i am getting is that within the datatemplate i have a radcombobox, and when loaded i want the selected value to be bound to the value form a radgridview, which is outside of the datatemplate. However this doesnt work. Here is what the datatemplate looks like;
<
DataTemplate
x:Key
=
"eventHeaderEditTemplate"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
Grid
Margin
=
"8,8,0,0"
d:LayoutOverrides
=
"Height"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"150"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
TextBox
x:Name
=
"txtEventStateID"
Text
=
"{Binding SelectedItem.EventHeader.EventStateID, ElementName=staticDataRadGrid}"
TextWrapping
=
"Wrap"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
Foreground
=
"{StaticResource StrongBrush}"
Grid.Column
=
"1"
Grid.Row
=
"6"
Margin
=
"0,0,0,2"
/>
<
Telerik:RadComboBox
ItemsSource
=
"{Binding EventStateDTOs,Source={StaticResource EventStateDTOViewModel},Mode=TwoWay}"
x:Name
=
"comboBoxEventState"
Grid.Column
=
"1"
SelectedValue
=
"{Binding SelectedItem.EventHeader.EventStateID, ElementName=staticDataRadGrid}"
Style
=
"{StaticResource RadComboBoxStyle}"
FontFamily
=
"Segoe UI Light"
FontSize
=
"24"
Margin
=
"0,0,0,2"
Grid.Row
=
"7"
VerticalAlignment
=
"Bottom"
Height
=
"40"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"Loaded"
>
<
cmd:EventToCommand
Command
=
"{Binding ExecuteCommand, Source={StaticResource EventStateDTOViewModel}}"
CommandParameter
=
"geteventstates"
></
cmd:EventToCommand
>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
<
Telerik:RadComboBox.ItemTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Name}"
Foreground
=
"{StaticResource MainBrush}"
/>
</
DataTemplate
>
</
Telerik:RadComboBox.ItemTemplate
>
</
Telerik:RadComboBox
>
</
Grid
>
</
Grid
>
</
DataTemplate
>