lundi 23 septembre 2019

GridViewCheckBowColumn Updates in UI after scrolling back to it

I have a RadGridView with one of the columns being a GridViewCheckBoxColumn. Upon clicking rhis column I want the checkbox to check / uncheck. I see my changes affecting the data and if I click on the column, scroll away from it and come back to it the row's check box is then updated. How do I make it so the check box updates automatically without me having to scroll away from it and come back to see the changes. Any help is appreciated.

Here's my selectedCellsChanged event in where I handle this checkbox column update:

<code>
private void SelectedCellsChanged(object sender, Telerik.Window.Controls.GridView.GridViewSelectedCellsChangedEventargs e)
{
if(!(this.grid.DataContext is ViewModel viewModel))
return;

var selectedItem = viewModel.selectedItem as Model;
if(grid.CurrentCellInfo.Column.Header.Equals("Selected"))
{
selectedItem.Selected = !selectedItem.Selected;
viewModel.SelectedItem = selectedItem;
}
}
</code>



Aucun commentaire:

Enregistrer un commentaire