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

Refresh sorting

3 Answers 324 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 29 Oct 2008, 04:32 PM
Is there any way how to refresh sorting on RadGridView easy way (i.e. force grid to re-sort according actual sorting settings)? I'm now using following code, but it's kind of ugly.
private void uxTourGrid_CellEndEdit(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)  
{  
    if (e.ColumnIndex == 0 && uxTourGrid.Columns[0].SortOrder != RadSortOrder.None)  
    {  
        RadSortOrder sort = uxTourGrid.Columns[0].SortOrder;  
 
        uxTourGrid.Columns[0].SortOrder = RadSortOrder.None;  
        uxTourGrid.Columns[0].SortOrder = sort;  
    }  
}  
 
I'm sorting according to first column.

Thanks for any help.

Regards,
Daniel

3 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 04 Nov 2008, 08:10 PM
Hi Daniel,

Thank you for your question.

I guess that you want to re-sort the column, because of the edited cell. That should work automatically. In addition, please see our help topics about sorting.

Do not hesitate to contact me back if you have further questions.

 
Best wishes,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 1
answered on 09 May 2012, 07:11 PM
I know this is an old thread, but i just recently ran into this issue using the unbound data mode where the grid was not refreshing the sorting after i added my rows to the grid.

After adding rows to the grid, i used the following code to update the grid view, which updating the sorting:

myGridView.MasterTemplate.Refresh();


Hope this helps anyone else who runs into this issue.
0
Stefan
Telerik team
answered on 14 May 2012, 12:05 PM
Hello Mark,

Thank you for writing.

I have just tested this scenario with our latest version and the grid is correctly re-sorted after adding new items. Attached you can find a sample application demonstrating that. 

Please let me know if your scenario is different, or if you found a case where this is not happening, so I can log it accordingly.

All the best,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Nick
Telerik team
Mark
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or