I call EditItem(), make my changes and then call CommitEdit(). Although the documentation says "That's it - the RadGridView will show the updated data immediately.", that doesn't seem to work for me. The change only appears when I enter edit mode in the grid by double-clicking the cell.
I've created a small project to demonstrate my issue.
<
Window
x:Class
=
"RadGridViewUpdate.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
StackPanel
>
<
telerik:RadGridView
x:Name
=
"grid"
/>
<
Button
Content
=
"Change"
Click
=
"OnChange"
/>
</
StackPanel
>
</
Window
>
public partial class MainWindow : Window
{
public class Test
{
public string first { get; set; }
public string second { get; set; }
public string third { get; set; }
}
Test entry1 = new Test() { first = "1", second = "2", third = "3" };
Test entry2 = new Test() { first = "1", second = "2", third = "3" };
public MainWindow()
{
InitializeComponent();
grid.Items.Add(entry1);
grid.Items.Add(entry2);
}
private void OnChange(object sender, RoutedEventArgs e)
{
grid.Items.EditItem(entry1);
entry1.second = "5";
grid.Items.CommitEdit();
}
}
When I click "Change", nothing is changed in the grid until I double-click the second column of the first row.
Note that this is just an example. In my full application, I use MVVM and did try to "RaisePropertyChange".