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

[Solved] Grid Row Stays in Edit Mode After Update Event Fires

5 Answers 380 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Suresh Mishra
Top achievements
Rank 1
Suresh Mishra asked on 08 Oct 2009, 08:15 PM
Hi,

I use in place edits for a rad grid using the code as in this location:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx

Although, I do not use an object source to populate the grid, everything works fine, except that the row stays in edit mode even after the grid update event has fired.  Is there any way I can set the double clicked row out of edit mode after the Update event?

Thanks.

Suresh

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Oct 2009, 05:12 AM
Hello Suresh,

You can hook the ItemUpdated event of the grid to trace whether the update action is executed successfully and then set the e.KeepInEditMode property to false in the ItemUpdated handler itself so that the edit form does not remain open. Here's a sample code:
c#:
protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e) 
        { 
            // after performing update 
 
                e.KeepInEditMode = false;               
        } 

Hope this helps..
Princy.
0
Suresh Mishra
Top achievements
Rank 1
answered on 09 Oct 2009, 03:19 PM
Hi Princy,

Thanks for your reply.  I tried your suggestion to set the keepineditmode to false in the ItemUpdated event of the rad grid.  However, this event never fires, maybe because I am using a custom source for the grid instead of an object source. 

Since I know which rowindex was updated, is there anyway to set the KeepInEditMode = False using the itemindex property of the row in question?

Thanks.

Suresh
0
Sebastian
Telerik team
answered on 15 Oct 2009, 12:34 PM
Hello Suresh,

You can hide explicitly the edit form by setting the Edit property of the respective GridDataItem to false and rebinding the grid. Basically, the edit form should be closed by default as illustrated on this online demo of the product:

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

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alfred Xavier
Top achievements
Rank 1
answered on 21 Oct 2009, 06:01 PM
Hello Suresh,

Did you got this fixed?
I mean "row staying in edit mode even after the grid update event has fired".
let me know what is  the solution?

Thanks
Alfred Xavier
0
Princy
Top achievements
Rank 2
answered on 22 Oct 2009, 07:04 AM
Hello Alfred,

Are you editing your grid manually or using Automatic operations. If you are performing the edit operation manually, then you should make sure that the AllowAutomaticUpdates property of the grid is set to false. If this does not help then, you can use the following line of code in the update event of the grid after successfully updating changes:
 e.Item.Edit = false

Thanks
Princy.
Tags
Grid
Asked by
Suresh Mishra
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Suresh Mishra
Top achievements
Rank 1
Sebastian
Telerik team
Alfred Xavier
Top achievements
Rank 1
Share this question
or