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

Reordering Columns causes error

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 03 May 2011, 04:38 PM
I have a Radgrid which will fill according to a combobox which contains a table name.
I can change the table with no problem using this combo box. I found I can do this to clear the filters:

 

 

foreach (GridColumn column in RadGrid1.MasterTableView.Columns)

{
    column.CurrentFilterFunction = 
GridKnownFunction.NoFilter;
    column.CurrentFilterValue = string.Empty;

RadGrid1.MasterTableView.FilterExpression = 

 

string.Empty;

 

RadGrid1.MasterTableView.Rebind();

 


How do I clear the sort and reorder columns?

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 06 May 2011, 11:53 AM
Hi Fred,

You can clear the sorting with the following line of code:
RadGrid1.MasterTableView.SortExpressions.Clear();
and call that line before rebinding the grid.

Regarding the columns reordering: There is no built-in mechanism for retrieving reordering back. You can save somewhere, in ViewState for instance, what is the initial columns order, then reorder them manually.

Best wishes,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Fred
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or