Hi,
Player_AllPlayers_GridView control inherits from the RadGridView and its ItemSource is set to an ObsarvableCollection maintained in a web service tier. In general everything works properly. I just cannot get control over my customised sorting. Since, I am using my own paging scheme, I would like to capture the Sorting event. Therefore, I am attaching a handler for it (see below). Then, in the handler I retrieve the items that I am interested in which are already sorted on the server. The RadGridView does display the new items correctly. Unfortunatelly, it does its OWN sorting beforhand. Setting e.Handled = true does not change anything, the "internal" sorting still happens first and my sorting afterwards.
The second question is about the DataLoaded event. It is executed after each row is loaded for the RadGridView. Is there an event that is executed (only once) after all rows have been loaded?
public partial class MainContent()
{
Player_AllPlayers_GridView grid;
[...]
public MainContent()
{
InitializeComponent();
//I am feeding an ObservableCollection reference to the RadGridView
grid = new Player_AllPlayers_GridView(MainPage.webservices.WebService.ProfileList);
grid.DataLoaded += grid_DataLoaded;
grid.Sorting += grid_Sorting;
}
}
void grid_Sorting(object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e)
{
string sortDesc = e.SortPropertyName;
if (e.NewSortingState == Telerik.Windows.Controls.SortingState.Descending)
sortDesc += "_desc";
// Here I am just repopulating the ObservableCollection that is assigned to this grid
HeaderClickRetrieveSortedProfiles(sortDesc);
e.Handled = true;
}
void grid_DataLoaded(object sender, EventArgs e)
{
[...]
}
regards, Przemek
Player_AllPlayers_GridView control inherits from the RadGridView and its ItemSource is set to an ObsarvableCollection maintained in a web service tier. In general everything works properly. I just cannot get control over my customised sorting. Since, I am using my own paging scheme, I would like to capture the Sorting event. Therefore, I am attaching a handler for it (see below). Then, in the handler I retrieve the items that I am interested in which are already sorted on the server. The RadGridView does display the new items correctly. Unfortunatelly, it does its OWN sorting beforhand. Setting e.Handled = true does not change anything, the "internal" sorting still happens first and my sorting afterwards.
The second question is about the DataLoaded event. It is executed after each row is loaded for the RadGridView. Is there an event that is executed (only once) after all rows have been loaded?
public partial class MainContent()
{
Player_AllPlayers_GridView grid;
[...]
public MainContent()
{
InitializeComponent();
//I am feeding an ObservableCollection reference to the RadGridView
grid = new Player_AllPlayers_GridView(MainPage.webservices.WebService.ProfileList);
grid.DataLoaded += grid_DataLoaded;
grid.Sorting += grid_Sorting;
}
}
void grid_Sorting(object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e)
{
string sortDesc = e.SortPropertyName;
if (e.NewSortingState == Telerik.Windows.Controls.SortingState.Descending)
sortDesc += "_desc";
// Here I am just repopulating the ObservableCollection that is assigned to this grid
HeaderClickRetrieveSortedProfiles(sortDesc);
e.Handled = true;
}
void grid_DataLoaded(object sender, EventArgs e)
{
[...]
}
regards, Przemek