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

Multi-row editing is lost when sorting

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 05 Jan 2009, 06:18 PM
I have a grid that is set to allow multi-row editing using the AllowMultiRowEdit property. The grid's Items collection is then walked in the first pass of the grid's PreRender event (i.e. when not a postback) and each GridEditableItem has its .Edit property set to true as per the example on this site.

The problem I'm having is that when the user clicks on a grid column header to sort by that column all of my rows exit edit mode and the input controls that were previously rendered for input disappear (as would be expected when coming out of edit mode).

What can I do to preserve edit mode on all of my rows when performing a grid sort? Should I hook into a different event after sorting to set each row's .Edit property back to true? Should I do this as part of the sort? Any guidance would be appreciated!

Rob

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Jan 2009, 05:09 AM
Hi Rob,

I tried implementing the desired scenario on my end and it is working as expected with Sorting. Here is the code which I tried:

CS:
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            item.Edit = true
        } 
        RadGrid1.MasterTableView.Rebind(); 
    } 


Thanks
Shinu
Tags
Grid
Asked by
Rob
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or