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 998105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:08:27+00:00 2026-05-16T07:08:27+00:00

I have a DataGridView in which one column has data that the user needs

  • 0

I have a DataGridView in which one column has data that the user needs to align by adding spaces. For example, the first two rows might contain:

kumbu
kuimbiu

And the user needs to be able to line up the letters that match by adding spaces. Something like this:

ku mb u
kuimbiu

Now in order to do that with the DataGridView, the user must enter edit mode in the top cell, add spaces, hit enter, re-enter edit mode in the bottom cell, and then add spaces. Our users would like to be able to, while in edit mode in the top cell, hit the down arrow and advance to the second cell while staying in edit mode, saving clicks or F2 hits.

Is there a good way to do this? I have tried trapping the down arrow key press, leaving edit mode, advancing a cell, and then entering edit mode with the grid’s BeginEdit method, but this does not do what I want.

Any ideas?

  • 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-16T07:08:28+00:00Added an answer on May 16, 2026 at 7:08 am

    When leaving the cell capture the edit status in a class variable. When the user presses down or enter, the next cell will begin edit mode, but only if the previous cell was in edit mode. You can add additional logic if you want it to be based upon columns.

    Private blnEditMode As Boolean = False
    Private Sub dgv_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv.CellEnter
        If blnEditMode Then
            dgv.BeginEdit(False)
        End If
    End Sub
    
    Private Sub dgv_CellLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv.CellLeave
        blnEditMode = dgv.IsCurrentCellInEditMode
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 510k
  • Answers 510k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I have pretty much the same approach, so does a… May 16, 2026 at 5:02 pm
  • Editorial Team
    Editorial Team added an answer You probably have to open the Configure Launches window on… May 16, 2026 at 5:02 pm
  • Editorial Team
    Editorial Team added an answer Mmmm.. you can certainly find out what strategy is being… May 16, 2026 at 5:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have an automatically binded DataGridView that obtains data and update data directly from
Im using c# .net windows form application. I have created a database which has
I have a WinForms application with DataGridView control. My control has five columns (say
Let's say that I have a form which runs a stored procedure. This stored
I am working on an application in which I have two database fields. One
Hi I have a datagridview which binds XML manually. I wish to sort out
I have a DataGridView with a combobox column in it, showing the possible prices,
I have a datagridview that is bound to a dataset I defined the table
I have a DataGridView bound to a DataSet. I only want a selection of
I have a custom IBinding List which raises the ListChanged event. I would like

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.