Hi,
I'm struggling on a sorting problem. I have 2 gridviews that are bound to the same list. Only one of the gridviews is editable. The other one is for reporting purposes only and so readonly.
Because they represent the same data, the filtering and sorting must be syncronized. For the sorting part, I've added a 'Sorting' event on grid n°1. In the event handler I copy the sorting descriptors into the second grid. This works fine.
When I edit a cell of one of the sorted columns in grid n°1, the grid is automatically sorted according to the existing sorting of that column. This is desired off course.
However, the event 'GridViewSorted' isn't called and thus my second grid doesn't sort, which makes that my grids aren't sorted equally anymore.
Does anybody have some advice on how to make sure my both grids are synchronized after a cell edit?
I've tried following already, but sorting on the 2nd grid just kicks in, when you enter and leave the same cell again after you've edited it.
I'm struggling on a sorting problem. I have 2 gridviews that are bound to the same list. Only one of the gridviews is editable. The other one is for reporting purposes only and so readonly.
Because they represent the same data, the filtering and sorting must be syncronized. For the sorting part, I've added a 'Sorting' event on grid n°1. In the event handler I copy the sorting descriptors into the second grid. This works fine.
private
void
GridViewSorted(
object
sender, GridViewSortedEventArgs e)
{
var datagrid = sender
as
RadGridView;
if
(datagrid ==
null
|| !datagrid.Equals(EmployeeGrid))
return
;
FormationGrid.SortDescriptors.Replace(datagrid.SortDescriptors);
}
When I edit a cell of one of the sorted columns in grid n°1, the grid is automatically sorted according to the existing sorting of that column. This is desired off course.
However, the event 'GridViewSorted' isn't called and thus my second grid doesn't sort, which makes that my grids aren't sorted equally anymore.
Does anybody have some advice on how to make sure my both grids are synchronized after a cell edit?
I've tried following already, but sorting on the 2nd grid just kicks in, when you enter and leave the same cell again after you've edited it.
private
void
EndCellEdit(
object
sender, GridViewCellEditEndedEventArgs gridViewCellEditEndedEventArgs)
{
var datagrid = sender
as
RadGridView;
if
(datagrid ==
null
|| !datagrid.Equals(EmployeeGrid))
return
;
FormationGrid.SortDescriptors.Replace(datagrid.SortDescriptors);
}