This is a migrated thread and some comments may be shown as answers.

RadGridView customised sorting problems

1 Answer 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Przemyslaw
Top achievements
Rank 1
Przemyslaw asked on 10 Nov 2009, 11:33 AM
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

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 11 Nov 2009, 10:39 AM
Hello Przemyslaw,

Please, see my reply in this forum thread.

All the best,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Przemyslaw
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or