Back Color Headertext

  • Thread starter Thread starter Nancy
  • Start date Start date
You need to use the HeaderBackColor property of your DataGrid or TableStyle.
Example:
this.dataGrid1.TableStyles[0].HeaderBackColor = Color.SlateGray;
this.dataGrid1.TableStyles[0].HeaderForeColor = Color.WhiteSmoke;
 
Hi Nancy,

I agree with our MVP , you may create a Table Style to customize the
appearance of the table.
You should set the mapping name in the table style to the corresponding
table name,a new table style didn't contain any columns, you need also add
the columns which you want to shown in the ColumnStyles collection in the
tablestyle. Also the Mapping name of the column style should be set to the
corresponding column name in the data table.

If you have any problem on using table style, please be free to relply this
thread.


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
The example works for all columns in the datagrid.
I will like to color each heading column with a different color.
 
This example colors all column headers for the datagrid.
I am looking to learn how to color each column header
with different colors.
-----Original Message-----
You need to use the HeaderBackColor property of your DataGrid or TableStyle.
Example:
this.dataGrid1.TableStyles[0].HeaderBackColor = Color.SlateGray;
this.dataGrid1.TableStyles[0].HeaderForeColor = Color.WhiteSmoke;

--
Tim Wilson
..Net Compact Framework MVP

Nancy said:
How could I set a different backcolors on a
datagrid.headertext only ?

Thanks!
Nancy.


.
 
As far as I know, unless you paint the column headers yourself or look for a
third-party control, the DataGrid does not support having a different color
header for each column.

--
Tim Wilson
..Net Compact Framework MVP

Nancy said:
This example colors all column headers for the datagrid.
I am looking to learn how to color each column header
with different colors.
-----Original Message-----
You need to use the HeaderBackColor property of your DataGrid or TableStyle.
Example:
this.dataGrid1.TableStyles[0].HeaderBackColor = Color.SlateGray;
this.dataGrid1.TableStyles[0].HeaderForeColor = Color.WhiteSmoke;

--
Tim Wilson
..Net Compact Framework MVP

Nancy said:
How could I set a different backcolors on a
datagrid.headertext only ?

Thanks!
Nancy.


.
 
Hi Nancy,

Current version of datagrid didn't support set color to individual column.
If you really need this feature and doesn't mind considering 3rd party
commercial datagrid controls, you may try the Xceed
Grid,(http://www.xceedsoft.com/products/GridNet/index.htm).

Also, you may try our MSWish program
(http://register.microsoft.com/mswish/suggestion.asp ) to let the product
group know what you want. Each suggestion has been received and is being
reviewed by the team that is most capable of addressing it.

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.

This response contains a reference to a third party World Wide Web site.
Microsoft is providing this information as a convenience to you. Microsoft
does not control these sites and has not tested any software or information
found on these sites; therefore, Microsoft cannot make any representations
regarding the quality, safety, or suitability of any software or
information found there. There are inherent dangers in the use of any
software found on the Internet, and Microsoft cautions you to make sure
that you completely understand the risk before retrieving any software from
the Internet.
 
Back
Top