Highlighting text in DataGridView

  • Thread starter Thread starter sh
  • Start date Start date
S

sh

How can I highlight the text in a cell, as if it had been selected with
the mouse?

I have a validation routine that checks the data in each column. If a
cell fails the validation, I show a MessageBox with an error message. I
then want to highlight the bad data. But I can't seem to do that.

I don't want to change the background color, nor the foreground color. I
just want to highlight it as if it had been selected by mouse.

In a TextBox, there is SelectionStart and SelectionLength. Is there
something similar in a DataGridView?

Thanks in advance.
 
..Net 2005:

DataGridView1.Rows(0).Cells(0).Style.BackColor = Color.Yellow

[]s

Cesar
 
Back
Top