Close when Edit / Insert is finished

By default, when you edit a row with RadGrid using PopUp or Forms (or even UserControl), the edit form should automatically close when you fire the Insert/Update command. For some "proof by example," check out these live demos:

That said, based on the RadGrid configuration you posted, it does not seem to be properly configured for data editing. I suggest you add a GridEditCommandColumn. This column will automatically provide the "Edit" button in the "read mode" and the "Update/Cancel" buttons in the edit mode. An example with this column can be found here:

Additionally, make sure your Page Validation is not causing problems with your data operations. I see that you've got some ASP.NET validation controls in your edit templates. If those do not validate, your grid will appear not to "exit" edit mode when the page is posted.

Give that a try and let me know if it helps. Add a comment Top achievements answered on 25 Sep 2009, 06:52 PM

I was having the same issue. I found that when I had started off I was using the automatic features but then later dropped them in favor of doing things manually. I had forgotten to set AllowAutomaticInserts = "True" back to false. From your post I can't tell too much about what your situation is, but if this applies to you I suggest trying it.

Also, I found my solution by quickly rebuilding another grid on another page to the point where it could be tested. Then I compared the properties and noticed what was different.

Add a comment Top achievements answered on 25 Sep 2009, 09:09 PM

I have tried it with validation and it without validation. The GridEditCommandColumn opens it up but the Insert and Update links are the ones that are having the issue. The problem is when you implement onInsertcommand and onUpdateCommand methods auto insert and updates must be set to false. I hammered all the possible combinations I could think of and Ed C. Was right on the money. Thanks for all your help.


//So the solution is set these to false

AllowAutomaticInserts = "False"
AllowAutomaticUpdates = "False"
// When you have these
OnInsertCommand = "RadGrid1_InsertCommand"
OnUpdateCommand = "RadGrid1_UpdateCommand"
Add a comment Top achievements answered on 29 Sep 2009, 06:22 PM

Thanks for reporting back, and I'm glad that my suggestion worked out for you. I burned a good hour or two with this my self and was wondering if the grid should throw some sort of error in place of this odd behavior.

Add a comment Top achievements answered on 06 Mar 2017, 06:02 PM That's works for me. Thanks! Add a comment Top achievements answered on 27 Mar 2017, 07:41 PM

You may also come across the situation if you have ajaxified your RadGrid because you are experiencing a partial postback of your page. If you have an "OnRequestStart" RadAjaxManager event handler for your page, you can catch the event firing when you click the "Insert" button. check the event target out to see if it is coming from your grid insertion click. if so, you may want to set_enableAjax to false for that specific request and see if that helps. I have something to the effect of the following and my RadGrid now successfully exits the "edit mode" of the grid. Note that I am using a UserControl to configure the mode of the grid. ajaxmanager