After "enter", how to stop entering edit mode on next row?

4 posts, 0 answers
  1. Frank
    Frank avatar
    18 posts
    Member since:
    Oct 2011

    Posted 26 Nov 2011 Link to this post

    I have editmode of the gridview on "default" (I've tried F2 also").  The problem is that after I edit the current row and press "enter", the gridview automatically put focus in the next row (which is ok), but it also put the next row into edit mode.  How do I stop that?  The reason I want to stop that is that I have a "messagebox" to confirm save changes in the rowvalidating event.  And when the user pressed "ok" or "cancel" on the current editing row, the gridview put next row into edit mode two which when user try to get out of that row, it also prompt them the messagebox which I don't want.

    Thanks in advance
  2. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 02 Apr 2012 Link to this post

    I have almost the same question which is to stop edit mode as my scenario is to have the grid to go at the newly added row however I don't know what you do but in the 2012.1.326.1050 when I press ENTER, the grid stops automatically to be in Edit mode the problem is when the user press TAB at the last column for a newly added row.  This goes to the second row in edit mode but the customer's request is to have the grid go to the newly added row and not in edit mode so he may enter additional information for that row elsewhere  So in brief, ENTER is all right with the code bellow but not TAB.  In a EDIT scenario I would understand but when adding a new row it's a bit different.  I actually have a support tiket going on asking for what to do in case the user press TAB at the last column of a newly added row in order to go to that row and stop being in edit mode like the ENTER does

    My RowEditEnded is actually as follow :

    private void rgvCustomers_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
        // Either Edit or Insert should save my commited row that's why I'm just checking if the row was commited
        if (e.EditAction == Telerik.Windows.Controls.GridView.GridViewEditAction.Commit)
            if (e.EditOperationType == Telerik.Windows.Controls.GridView.GridViewEditOperationType.Insert)
                rgvCustomers.CurrentColumn = rgvCustomers.Columns[0];
                SelectedCustomer = e.NewData as ProxyCode.Proxy_Customer;
                rgvCustomers.CurrentItem = SelectedCustomer;
            Proxy.SaveCustomerAsync(Gear.ServiceKey(), e.EditedItem as ProxyCode.Proxy_Customer);
            CustomerDetailContainer.DataContext = SelectedCustomer;
  3. Hubert Frick
    Hubert Frick avatar
    8 posts
    Member since:
    Nov 2009

    Posted 27 Jul 2012 Link to this post

    I have exactly the same scenario, as Frank describes in his post. I can compare all the old values with the new values of the row, and only continue with saving the data when modified data is entered. It would be nice if there would be an easier approach, I couldn't find any!
  4. Saif
    Saif avatar
    2 posts
    Member since:
    Apr 2013

    Posted 01 Apr 2013 Link to this post

    After "enter", how to stop entering edit mode on next row

    I have this same issue on my grids...... any replies to this post ???

Back to Top