Welcome to the Xceed Community | Help
Community Search  
More Search Options

EndEdit Failing (Bug?)

Sort Posts: Previous Next
  •  11-06-2009, 2:49 PM Post no. 24805

    EndEdit Failing (Bug?)

    Attachment: EndEditError.zip

    Y'all,

    I am getting an "An attempt was made to end the edit process while it is already in the process of being ended" error very repeatably the second time I save inserted data when starting from an initially empty grid.  I've boiled the problem code down to a very stripped down example (about 20 lines of code) which I am including in the attached file.  The steps necessary to see the error are:

    1) Run the program

    2) Enter some text in the insert row in the grid

    3) Click "Save"

    4) Enter some new text in the insert row in the grid

    5) Click "Save"

     Step five will produce the error. 

    I don't think that calling "EndEdit" is explicitly required to get this error, although that is the line of code where the error will be seen in the attached example.  I was also able to get a similar behavior in a version of the code without the "EndEdit" call but the steps for reproducing it that way are more complicated.

    I upgraded to build 3.5.9502.16400, to no avail.

    Has anyone else run into this problem?  Am I doing something invalid or is this a bug?

     Thanks,

    -JLS

  •  11-10-2009, 10:52 AM Post no. 24824 in reply to 24805

    Re: EndEdit Failing (Bug?)

    For anyone following this thread...

    Tech support acknowledged that the behavior I noted is a bug and indicated that it would be fixed in a future version.  They also supplied the following workaround (which worked fine in my code):

     For the time being, please use the following workaround to make your code work:

       Private Sub cmdSave_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles cmdSave.Click

            grdPerformanceObjectives.EndEdit()

            _PerformanceObjectives.AcceptChanges()

             If grdPerformanceObjectives.CurrentItem Is Nothing Then

                grdPerformanceObjectives.Items.MoveCurrentToFirst()

            End If

        End Sub

     -JLS

  •  11-16-2009, 5:19 PM Post no. 24880 in reply to 24805

    Re: EndEdit Failing (Bug?)

    I just encountered this bug myself.  Two grids in my application are acting weird after I insert something. When I press enter new data into the InsertionRow and press "Enter", a new row shows up in the grid area, but the same data still shows in the InsertionRow.  The odd thing about this is that it seems to only happen for the first row entered, the grid must be bound to an empty BindingList<T>, or this problem will not manifest itself.

    I just happened to hover over the InsertionRow area after this occured, and a small pop-up occured saying "An attempt was made to end the edit process while it is already in the process of being ended."  I never got an exception thrown or anything else to indicate some abnormal behavior.  I just happened to move my mouse over the InsertionRow to get this to happen.

    Ryan

  •  11-18-2009, 5:17 PM Post no. 24913 in reply to 24824

    Re: EndEdit Failing (Bug?)

    This work-around won't work for me as the EndEdit method is the one throwing the exception on cell edit.

    Do I need to contact tech support to provide a specific example?

    Is there a way to check if the grid is in the process of ending the edit?

  •  11-25-2009, 11:28 AM Post no. 24992 in reply to 24913

    Re: EndEdit Failing (Bug?)

    You will get an exception if there are some ValidationErrors or any other problems commiting the new data in the DataSource. 

    If it's not the case, send a repro app to support@xceed.com mentioning this forum post and we'll have a look at it. 


    Christian Nadeau
    Software Developer
    Xceed Software Inc.
  •  12-01-2009, 3:21 PM Post no. 25044 in reply to 24992

    Re: EndEdit Failing (Bug?)

    I too ran into this bug.  This being the second round of bugs on InsertionRow, and not really liking how the whole Commiting/Canceling/CreatingNewItem cycle fit in (or didn't) with my MVVM code anyway, I re-evaluated and just plain took out the InsertionRow, instead adding a button for "add item" that adds a new blank row to the collection, which then has to be completed or removed before the overall record is saved.  Might not work in every case, but does in mine and overall involves less code in fewer places.

     -Scott

  •  01-10-2010, 5:07 PM Post no. 25381 in reply to 25044

    Re: EndEdit Failing (Bug?)

    i am coming across the exact same bug too. Is there any resolution? I tried the EndEdit workaround but calling grid.EndEdit throws the same exception
  •  02-12-2010, 10:26 AM Post no. 25771 in reply to 25381

    Re: EndEdit Failing (Bug?)

    Just to clarify, calling EndEdit is NOT the workaround.  That is the line of code where I encountered the bug.  The workaround was to ensure that there is a current item after the EndEdit has been called as in the following code:

             If grdPerformanceObjectives.CurrentItem Is Nothing Then

                grdPerformanceObjectives.Items.MoveCurrentToFirst()

            End If

    If you're not calling EndEdit, you may need to search for an appropriate event to add this code to, I'm not sure.

     -JLS

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.