We have a requirement where in in radgridview data column's cell template we have set the collection's property and in edit template, we have a combobox. Now, based on the radgridcombocolumn which is nothing other than the previous column selection, i have to show the values in the edit template combobox. If I select some values in the edit template combo box, it wont set because I have applied a textblock and bind the value to some property.
In order to change the property of the textblock, I have to access the same in code behind and set the selecteditem value of the combobox.
Kindly help.
<
telerik:GridViewDataColumn Header="State" UniqueName="StateComboColumn" IsGroupable="False" HeaderCellStyle="{StaticResource MyHeaderCellStyle}" TextAlignment="Right" >
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding stateName}"/>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
<telerik:GridViewColumn.CellEditTemplate>
<DataTemplate>
<telerik:RadComboBox ItemsSource="{Binding StateCollection}" DisplayMemberPath="name" DropDownOpened="RadComboBox_DropDownOpened"/>
</DataTemplate>
</telerik:GridViewColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
private void RadComboBox_DropDownOpened(object sender, EventArgs e)
{
RadComboBox objTempRadCombo = sender as RadComboBox;
objTempRadCombo.ItemsSource = StateCollection;
objTempRadCombo.DisplayMemberPath =
"name";
//HOw do I set the textblock to the selecteditem of this combobox here?
}