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

The edit state of a row changed after delete another row above it.

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rui
Top achievements
Rank 1
Rui asked on 23 Nov 2015, 09:07 AM

Hi,

     Now I am looking into this demo

     http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/commanditem/defaultcs.aspx

     First, I edit the second row in the gird, then delete the first row. I found after the first row was deleted. The original second row(now it is the first row after deleting) lost "in edit" state. And the original third row(now it changed to the second row) got the "in edit" state.

     Is it a software defect? And is there any solution now?\

Thanks.

Zhang Rui

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 25 Nov 2015, 07:51 AM
Hi Zhang,

This is due to the fact that the grid uses the index of the row when keeping it in Edit mode. When a prior item is deleted, naturally the indexes are altered by 1 and the next row gets opened in Edit mode. This is not Telerik specific behavior, as you will also encounter it with regular ASP.NET data visualization controls. To resolve it, you need to include some conditional custom logic. For example, you can clear the Edit indexes after deleting a record. Or you can preserve the Unique ID of the record depending on your database specifics and re-open it Edit mode manually.

I hope the clarification was helpful.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Rui
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or