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

Reordering grid Columns in Server Side

0 Answers 12 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vinodh B
Top achievements
Rank 1
Vinodh B asked on 06 Aug 2012, 02:04 PM
GridColumnCollection cols = grid.MasterTableView.Columns;
GridColumn c = cols.FindByUniqueName(columnName);
if (c != null){ 
    int start = c.OrderIndex; 
    for (int i= start; i < cols.Count; i++)  
    { 
        c = cols[i]; 
        if (i < cols.Count - 1)   
            c.OrderIndex = i+1;
        else     
            c.OrderIndex = start;  
    }
}

the above code doesn't work when reordering columns through server side. I have written the above code in 
pageload event . I also tried by setting the various properites like ReorderColumnsOnClient=false but it 
doesn't work . 

Kindly suggest alternatives 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Vinodh B
Top achievements
Rank 1
Share this question
or