Ticket Q302383
Visible to All Users

ASPxGridView - The inline edit form is not closed when the Update button is pressed

created 14 years ago

I click "Edit" & the in-line editor opens with two new links: "Update" "Cancel" after an edit I click "Update" it updates fine but does not close the in-line editor. To close the editor I have to click "Cancel".
I've checked the cs code, the aspx code, and the properties but I don't see anything different. Yet, on one grid the in-line editor closes after "Update" is clicked and on the other it does not.
What am I missing?
Thanks,
Phil

Show previous comments (8)
DevExpress Support Team 14 years ago

    Phil,
    I apologize that I cannot find a solution by reading your code. I am glad that the issue is solved, and you shared your fix with us.
    Feel free to close the report, if you do not need my further assistance on this topic.
    Thanks,
    Vest

      What part of the following don't you understand???
      --------------------------------------------------
      One line in the
         protected void gridRegions_RowUpdating
      method was missing, it was:
         gridRegions.CancelEdit(); // This line closes the line Editor.
      --------------------------------------------------
      Can you not find the method, "protected void gridRegions_RowUpdating" in my code? I find it in the zip file cs file just fine. The lines are:
          protected void gridRegions_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
          {
              e.Cancel = true;
              object key = e.Keys[0];
      just put the missing line after the object key line as in:
          protected void gridRegions_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
          {
              e.Cancel = true;
              object key = e.Keys[0];
              gridRegions.CancelEdit(); // This line closes the line Editor.
      and then it works & closes the in-line editor.

        Isn't this in some documentation some place???
        I looked up "CancelEdit()" & found this:
        http://www.devexpress.com/Support/Center/e/E1522.aspx
        It's supposed to cancel the edit but it also closes the in-line editor & I guess that if all your changes have been saved then when is "cancels" it does not wipe out changes made in the table it just closes the in-line editor. I think that example would have confused me since I didn't want to cancel the edit just the editor & perhaps that's what's confusing you?

        Answers

        created 14 years ago

        Phil,
        The difference between the ASPxClientGridView.CancelEdit and ASPxClientGridView.UpdateEdit methods is that the first method simply switches the grid to browser mode without sending values from the grid's inputs to the datasource.
        When the Update button is pressed, the grid's code collects all values from the editors (e.NewValues collection) and passes them to the datasource.
        Usually, when users perform custom updating, they get values from editors manually, store them in the database and then close the edit form with the ASPxClientGridView.CancelEdit method.
        Thanks,
        Vest

          Show previous comments (1)
          DevExpress Support Team 14 years ago

            Phil,
            Yes, you are right. Thank you for your reply.
            Thanks,
            Vest

              I have the same issue with Batch Edit Mode.
              After I call 'grid.UpdateEdit()' it update correctly the database, in effect if I call 'grid.Refresh()' I can see the new value and the grid seems to exit from edit mode.

                Hello,

                I have created a separate ticket on your behalf to process your inquiry more effectively:
                T105383: ASPxGridView / Batch Editing - The EditForm is not closed
                Please refer to it for further correspondence.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.