By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,781 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,781 IT Pros & Developers. It's quick & easy.

DataGridViewColumns tab order

P: n/a
Hi

Is there a way to remove DataGridViewColumns from the tab order in a
DataGridView ?

Thx

Dieter De Doncker
Mar 31 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Dieter De Doncker wrote:
Hi

Is there a way to remove DataGridViewColumns from the tab order in a
DataGridView ?

Thx

Dieter De Doncker


You can catch when a Column gets focused and then move it to the next
one. Would that do it for you?

Chris
Mar 31 '06 #2

P: n/a
Chris wrote:
Dieter De Doncker wrote:
Hi

Is there a way to remove DataGridViewColumns from the tab order in a
DataGridView ?

Thx

Dieter De Doncker


You can catch when a Column gets focused and then move it to the next
one. Would that do it for you?

Chris


Forgot to say that you can use the CellEnter event to do this. Just set
your new column:

DataGridView.CurrentCell = DataGridView.Item(e.ColumnIndex + 1, e.RowIndex)

Chris
Mar 31 '06 #3

P: n/a
Hi Chris

Following your tip; this is my code now

if (e.ColumnIndex == contactNameDataGridViewTextBoxColumn.Index)
{
customersDataGridView.CurrentCell = customersDataGridView[e.ColumnIndex
+ 1, e.RowIndex];
}

at runtime it seems to work but, I get:

System.InvalidOperationException: Operation is not valid because it results
in a reentrant call to the SetCurrentCellAddressCore function.

Also this solution has the disadvantage that the cell cannot be selected by
mouse.

Dieter

"Chris" <no@spam.com> schreef in bericht
news:u7**************@TK2MSFTNGP09.phx.gbl...
Chris wrote:
Dieter De Doncker wrote:
Hi

Is there a way to remove DataGridViewColumns from the tab order in a
DataGridView ?

Thx

Dieter De Doncker


You can catch when a Column gets focused and then move it to the next
one. Would that do it for you?

Chris


Forgot to say that you can use the CellEnter event to do this. Just set
your new column:

DataGridView.CurrentCell = DataGridView.Item(e.ColumnIndex + 1,
e.RowIndex)

Chris

Apr 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.