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

RADGrid Multi row edit with Sorting problem

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 06 Jun 2012, 10:27 AM
Hi,

I have been trying your RADGrid demo at:

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editmodes/defaultcs.aspx

....with Inline editing, and multi row edit selected.

There appears to be a problem in the following kind of scenario...
- Sort by "Last Name" Descending
- Click Edit on rows with the surnames "Leverling", "King", and "Fuller" so that they are all open for editing.
- Change "Leverling" to "Everling" (so that on update it changes position in the sort order.)
- Click Update on the "Everling" row.

The "Everling" row changes position but remains open for edit.

The "King" row takes the position of the "Everling" row in the grid and is made read-only.

It appears that the grid sorts the data without correctly tracking which rows should (or should not) be in edit mode.

Is there a way to fix it?

Thanks

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 11 Jun 2012, 12:06 PM
Hello Simon,

I confirm that the described behavior is indeed observed, however, actually this is expected since editing is related to the unique attribute of a row - the ItemIndex. And when sorting changes the rows place distribution after updating an item, the viewstate reloads the edited items according to their items' indexes. Therefore, if some items have been replaced during the process, the item that is opened in edit mode is not the user defined, but the one which has the itemindex from the saved state of the grid.

One possible workaround would be to use a custom Dictionary class to keep a pair of the unique DataKeyID and the ItemIndex of the items being edited, and after updating one of them, to open the rest of the items on edit form according to their DataKeyIDs.

Thank you for the understanding and sorry for any inconvenience caused.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or