don't show selection in data grid view

mbalderas

New member
Joined
Jul 4, 2007
Messages
4
Programming Experience
3-5
hey!
i've been looking for some code or property that gives my datagridview the apperance of not selecting anything.
i came up with the idea that if i set the HighlightColor to the same of the non selected cells, it would look like i'm not selecting anything... but then appears the freaking :mad: FocusRect...

how should i do it?
 
If you set dgv.CurrentCell=Nothing then nothing is selected and nothing appears selected.
 
:) such a great idea...

now the problem might be when to set that property... when clicking when focusing, or when?

is that the most correct way to do this..i mean, am i the only weirdo who uses the dgv as a "showing data" control?

thanksss!!
 
The ClearSelection method is better, set it initially and also in SelectionChanged event, plus ReadOnly=True.
 
Not here, doing that makes the cells totally untouchable, almost, add AllowUserToResizeColumns+Rows=False also. Are you referring to the row header arrow perhaps? RowHeaderVisible can be set False.
 
yeah, i want to make them untouchable, i mean i'm just using them for showing some data...

once I quicly read that the way to wipe out the focus rect is somehow with some drawings methods.. jojo i really don't remeber well..

thanks man
 
Back
Top