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

Right way how to close inline edited or inserted row

2 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vasssek
Top achievements
Rank 1
Vasssek asked on 09 May 2011, 08:17 PM
Hello,

I have two radgrids in the same page, both have used inline edit mode.
I've set some row in the grid1 to edit mode. Next step is to set another row in the grid2 to edit mode and simultaneously close edited row in grid1. The problem is, that sometimes it doesn't work. The row in grid1 is still in edit mode, even I used standard commands to close it:

RadGrid1.MasterTableView.IsItemInserted = false;
RadGrid1.MasterTableView.ClearEditItems();  
RadGrid1.Rebind();

Today I've found another command which when I apply it closes edited row as I needed :)
This is the code line which did the job for me:

RadGrid1.EditIndexes.Clear();

Could somebody explain to me the difference between above mentioned commands. When to use which one ?

Thanks

Vasssek

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 13 May 2011, 08:51 AM
Hi Vasssek,

It is possible RadGrid1.MasterTableView.ClearEditItems(); to not work
if you enabled the automatic update/insert/delete for your grid and at the same time when you update/insert records with code wiring the UpdateCommand/InsertCommand events. This can force the edit/insert form to remain open. If this is the case, please set the AllowAutomaticUpdates/AllowAutomaticInserts/AllowAutomaticDeletes to false.

Additionally,you can use RadGrid1.EditIndexes.Clear(); when you need to display different edit forms for Telerik RadGrid on edit and insert action. Please refer to the help article below for more information:
http://www.telerik.com/help/aspnet-ajax/grid-different-edit-forms-on-edit-and-insert.html

Regards,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start 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.

0
Vasssek
Top achievements
Rank 1
answered on 13 May 2011, 03:06 PM
Hmm,

I don't have set automatic update/insert/delete for my two radgrids, but maybe their rows are taken as two different edit forms and that's why it didn't work.

So, thank you for your explanation, now it's clearer to me :))

Best regards.

Vasssek
Tags
Grid
Asked by
Vasssek
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Vasssek
Top achievements
Rank 1
Share this question
or