|
-
Oct 4th, 2010, 07:28 AM
#1
Thread Starter
Lively Member
Disable tha highlightning
In my project I have a DataGridView with only one row. See here:

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
-
Oct 4th, 2010, 07:44 AM
#2
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.
-
Oct 4th, 2010, 07:45 AM
#3
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.
-
Oct 4th, 2010, 11:54 AM
#4
Thread Starter
Lively Member
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
-
Oct 4th, 2010, 05:31 PM
#5
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.
-
Oct 5th, 2010, 07:51 AM
#6
Thread Starter
Lively Member
Re: Disable tha highlightning
jmcilhinney,
That way nothing is accomplished.
Does anyone know how to do it?
Onenew
-
Oct 5th, 2010, 10:44 AM
#7
Re: Disable tha highlightning
 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.
-
Oct 5th, 2010, 05:39 PM
#8
Re: Disable tha highlightning
 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.
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
|