-
May 21st, 2015, 01:23 PM
#1
Thread Starter
Frenzied Member
Setting a DataGridView cell to edit mode
I want to set a DGV cell to edit mode on form load so that a user can start entering text as soon as the form is shown. I set the current cell to the first cell in the first row & then call BeginEdit on the DGV, but I still have to click on the cell to enter text. Is there anything I can do to eliminate having to click in the cell?
-
May 21st, 2015, 11:57 PM
#2
Re: Setting a DataGridView cell to edit mode
You're probably doing it in the Load event handler, which is executed before the form is actually displayed. Try doing it in the Shown event handler, which is executed after the form is first displayed. You'd presumably have to make sure that the grid is focused, so either make it first in the Tab-order or else call its Select method on Shown. You'd then set the CurrentCell property and call the BeginEdit method. I haven't tested that but it's what I'd do first.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|