Colors in a DataGrid

G

Geoff Jones

Hiya

I'm hoping that somebody can help me with something that has been puzzling
me today.

I have a DataGrid. I can change the colors of various thing e.g. the
Background color of the DataGrid. However, there is one color, no matter how
much I try, that I can't change. If I fill the DataGrid with data, the first
item i.e. in the top left of the grid is automatically selected i.e. the
text is highlighted in Blue. The text behind the highlighted text is a grey
color (which I assume is the Control color). However, I don't seem to be
able to set this to another color.

Does anybody know how to do this?

Thanks in advance

Geoff
 
K

Ken Tucker [MVP]

Hi,

http://www.onteorasoftware.com/downloads/coloredcolumns.zip

Ken
----------------
Hiya

I'm hoping that somebody can help me with something that has been puzzling
me today.

I have a DataGrid. I can change the colors of various thing e.g. the
Background color of the DataGrid. However, there is one color, no matter how
much I try, that I can't change. If I fill the DataGrid with data, the first
item i.e. in the top left of the grid is automatically selected i.e. the
text is highlighted in Blue. The text behind the highlighted text is a grey
color (which I assume is the Control color). However, I don't seem to be
able to set this to another color.

Does anybody know how to do this?

Thanks in advance

Geoff
 
A

aaronwhitpan

You should look into the 'SelectionBackColor' and 'SelectionForeColor'
of the Datagrid options. If you don't setup a custom tablestyle within
your code, changing these values in the designer should produce your
desired output.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top