Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 693497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:45:35+00:00 2026-05-14T02:45:35+00:00

when I am editing a cell and press enter the next row is automatically

  • 0

when I am editing a cell and press enter the next row is automatically selected, I want to stay with the current row… I want to happen nothing except the EndEdit.

I have this:

private void dtgProductos_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            dtgProductos[e.ColumnIndex, e.RowIndex].Selected = true; //this line is not working
            var index = dtgProductos.SelectedRows[0].Cells.IndexOf(dtgProductos.SelectedRows[0].Cells[e.ColumnIndex]);
            switch (index)
            {
                case 2:
                    {
                        dtgProductos.SelectedRows[0].Cells[4].Selected = true;
                        dtgProductos.BeginEdit(true);
                    }
                    break;
                case 4:
                    {
                        dtgProductos.SelectedRows[0].Cells[5].Selected = true;
                        dtgProductos.BeginEdit(true);
                    }
                    break;
                case 5:
                    {
                        btnAddProduct.Focus();
                    }
                    break;
                default:
                    break;
            }
        }

so when I edit a row that is not the last one I get this error:

Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:45:36+00:00Added an answer on May 14, 2026 at 2:45 am

    I think you’ll need to override ProcessEnterKey to not advance focus to the next row.

    Maybe this thread will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to receive the key press events during cell editing in DataGridView control.
In SSMS, when editing a row of data in a table, you can press
I've set stuff in a DataGridTemplateColumn.CellEditing DataTemplate. I want that when the cell editing
I'm using jqGrid with cell editing and a datepicker. All works well, except that
I need to know when the user finishes editing a cell in an NSTableView.
When editing HTML in emacs, is there a way to automatically pretty-format a blob
I want to be able to check if I can edit a cell in
I have a UITableView , when a cell is taped I want to delete
I'm having some trouble with editing a gridview row's background color when Editing it.
I have a grid and a button. I want to be able to press

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.