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

MultiRowEdit doesnt save changes

4 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Beck
Top achievements
Rank 1
David Beck asked on 12 Oct 2010, 06:59 PM
OK i have a grid with multirow edit. The issue I am running into is when i click to update 1 row and edit column 3, then click to edit row 5 the previous data is lost.

The only way around this is to click edit on ALL the row first that i desired to edit then perform my data entry.

Or place all rows in edit mode which makes the page take a LOT longer to load

4 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 18 Oct 2010, 09:12 AM
Hello David Beck,

Note that when "Edit" command is triggered, RadGrid rebinds itself in order to put the relevant item into edit mode. One of the side effects of this rebind is that the grid gets its initial data from the data source. That is why the modified data in the column editors of the other currently edited items is lost. The same would happen in case another command that requires grid rebind (paging, sorting etc.) is triggered.

One option to workaround this behavior is to update your data source before the grid is rebound. You can do this on the OnItemCommand server side event. Additionally you may need to persist the items that are in edit mode if the update command from my previous sentence requires grid rebinding.

I have attached a small sample project that demonstrates the approaches above. Give it a try and let me know how it goes on your side.

Best wishes,
Martin
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
David Beck
Top achievements
Rank 1
answered on 17 Nov 2010, 11:01 PM
Sorry I haven't gotten to toner. I have been pretty swamped.

I tried to load your sample but unfortunately im unable to connect to the DB you sent in the sample.

Do you guys plan to add a Client side edit/backup load features?

I have seen it with my previous controls vendor and it really was nice to have
0
David Beck
Top achievements
Rank 1
answered on 17 Nov 2010, 11:27 PM
I i finally got the DB to work with SQL 2008 and vs2008

However your sample still doesnt do as i expected.

Basically a user wants to go through and edit mutiple rows like below

LOAD GRID

Edit Row 3
Data Changed

Edit row 10
Data Changed

Edit Row 1
Data Changed

SAVE ALL DATA

Yours Just asks if they want to save after each row with its performing a batch update
0
Martin
Telerik team
answered on 23 Nov 2010, 01:23 PM
Hello David Beck,

Note that you can not put an item into edit mode without causing the grid to rebind itself. However the rebinding operation causes the grid to gets its data form its source and not from the viewstate. Therefore once you put another item into edit mode (or trigger another command that forces grid rebind), any unsaved data changes of another edited items will be lost. You should save that data either on the server (as demonstrated in my sample project) or on the client. One possible option to save the changes on the client and perform batch server update is shown in this online demo.

I hope this helps.

All the best,
Martin
the Telerik team
Browse the vast support resources we have to jumpstart 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
David Beck
Top achievements
Rank 1
Answers by
Martin
Telerik team
David Beck
Top achievements
Rank 1
Share this question
or