|
-
Aug 10th, 2010, 12:28 PM
#1
Thread Starter
Hyperactive Member
Disable cursor moving from cell to cell in datagridview
Is it possible to disable cursor moving from cell to cell in datagridview?
-
Aug 10th, 2010, 01:52 PM
#2
Frenzied Member
Re: Disable cursor moving from cell to cell in datagridview
I would think so. When they press tab, set the active cell to the cell at 0,0. same with click.
you would handle the cell click event and the key press event of the datagridview.
To set the current cell,(e.g) Datagridview1.CurrentCell = DataGridView.Rows(0).Cells(0)
Justin
-
Aug 10th, 2010, 09:13 PM
#3
Re: Disable cursor moving from cell to cell in datagridview
As stated, your request doesn't really make much sense. Could you please provide a FULL and CLEAR explanation of EXACTLY what you're trying to achieve and, just as importantly, why? If you're lazy when posting and try to save yourself a few seconds by making your post as short as possible then you end up wasting lots of your time and ours as we go back and forth trying to work out what you actually want when you could have just told us properly in the first place.
-
Aug 11th, 2010, 07:49 AM
#4
Thread Starter
Hyperactive Member
Re: Disable cursor moving from cell to cell in datagridview
Sorry, here is more detail.
I added button at first column of datagridview. Some user like using tab key to move cursor. What I want is to make cursor only stay at first column and moving form first row to last row. I do no want user using tab key to move any cell other than first column.
-
Aug 11th, 2010, 08:02 AM
#5
Re: Disable cursor moving from cell to cell in datagridview
So you don't really want to disable the cursor moving from cell to cell at all, do you? You actually want to prevent the cursor leaving the first column, right? For future reference, if you don't tell us what you actually want then we can't really tell you how to achieve it.
I think a bit of experimentation is in order. I'll get back to you.
-
Aug 11th, 2010, 08:14 AM
#6
Frenzied Member
Re: Disable cursor moving from cell to cell in datagridview
I did something like this. I had a payment input column as a last column on a datagridview. I just started with a variable set to zero. and when they pressed tab, I caught it, incremented my variable by 1, and set the currentcell as the one at (variable,lastcolumn). If the variable's value was equal to the rows.count -1, then I set the variable back to zero (looping within the same column).
Justin
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
|