Hi
I have a question on using the CellEditTemplate which has a TextBox in RadGridView.
I have a RadGridView, one of its columns is created like this in cs file:
gvColumn = new GridViewDataColumn();
gvColumn.CellEditTemplate = (DataTemplate)grid.TryFindResource("TextBoxEditTemplate");
gvColumn.DataType = typeof(string);
gvColumn.DataMemberBinding = new Binding(...)
<telerik:RadGridView.Resources>
<DataTemplate x:Key="TextBoxEditTemplate">
<TextBox Text="{Binding RelativeSource={RelativeSource Self}, Path=DataMemberBinding.PropertyPath}"/>
</DataTemplate>
...
but the 'Text' of this text box is not bound to content of the cell, they are sperated, when user tries to edit, the cell's content is not
in the TextBox, and vice versa.
Thanks.
Henry
I have a question on using the CellEditTemplate which has a TextBox in RadGridView.
I have a RadGridView, one of its columns is created like this in cs file:
gvColumn = new GridViewDataColumn();
gvColumn.CellEditTemplate = (DataTemplate)grid.TryFindResource("TextBoxEditTemplate");
gvColumn.DataType = typeof(string);
gvColumn.DataMemberBinding = new Binding(...)
In xaml file I define the template like this:
<telerik:RadGridView.Resources>
<DataTemplate x:Key="TextBoxEditTemplate">
<TextBox Text="{Binding RelativeSource={RelativeSource Self}, Path=DataMemberBinding.PropertyPath}"/>
</DataTemplate>
...
but the 'Text' of this text box is not bound to content of the cell, they are sperated, when user tries to edit, the cell's content is not
in the TextBox, and vice versa.
Thanks.
Henry