Disable tha highlightning
In my project I have a DataGridView with only one row. See here:
http://img266.imageshack.us/img266/3461/jwavila.png
But I have to change something. When the datagridview appears, the first cell is highlighted what I dont want, because, in this case, this is confusing.
Is there any possibility to disable this highlight?
Thanks in advance.
Onenew
Re: Disable tha highlightning
Set the focus on a different control when the form opens.
Typically I use the ever present "Cancel" or "Close" button.
Re: Disable tha highlightning
That would indicate that your DataGridView is first in the Tab order, so it gets focus when the form opens. Change the Tab order so it's not first.
Re: Disable tha highlightning
Hi, jmcilhinney and Hack,
I set the TabIndex for DataGridView to 99 , set another textbox to focus or select, but still is the same case.
Onenew
Re: Disable tha highlightning
Well, you wouldn't set the TabIndex to 99 for a start. Simply click the Tab Order button on the tool bar and then click the controls in the order you want them.
Try setting the grid's CurrentCell to Nothing in the form's Shown event handler.
Re: Disable tha highlightning
jmcilhinney,
That way nothing is accomplished.
Does anyone know how to do it?
Onenew
Re: Disable tha highlightning
Quote:
Originally Posted by
Onenew
I set the TabIndex for DataGridView to 99 , set another textbox to focus or select, but still is the same case.
Set the Tabindex of the textbox you selected to 0
That is the only tabindex you need to worry about.
Re: Disable tha highlightning
Quote:
Originally Posted by
Onenew
jmcilhinney,
That way nothing is accomplished.
Does anyone know how to do it?
Onenew
I tested it and it worked, so you did something wrong.