We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Export to Html

Thread ID:

Created:

Updated:

Platform:

Replies:

67598 Aug 24,2007 08:46 AM Sep 4,2007 02:11 AM Windows Forms 1
loading
Tags: GridControl
Faheem Rauf
Asked On August 24, 2007 08:46 AM

Hi, I am Exporting a GridDataBoundGrid to HTML. I want to apply colors to specific columns. First two columns should have red color, and remaining columns should be green. Please guide me how can I achieve such a functionality?

tempGrid.DataSource = objDataTable;
tempGrid[1,1].BackColor = Color.Red;
string strHtml = ExportAsHTML(rL).ToString();
Regards
Ali


Jeba S [Syncfusion]
Replied On September 4, 2007 02:11 AM

Hi Ali,

Sorry for the delay in response.

You can change the backcolor of a particular column by using the GridDataBoundGrid.Model.ColStyles[index].BackColor property. Setting the back color property for by specifying its row index and column index value will work only for the grid control. And as for the GridDataBoundGrid you need to use ColStyles property in order to change the back color for a specific column.


this.gridDataBoundGrid1.Model.ColStyles[1].BackColor = Color.Red;
this.gridDataBoundGrid1.Model.ColStyles[2].BackColor = Color.Red;

this.gridDataBoundGrid1.Model.ColStyles[3].BackColor = Color.Green;
this.gridDataBoundGrid1.Model.ColStyles[4].BackColor = Color.Green;


Please refer the sample which implements the above:
http://websamples.syncfusion.com/samples/Grid.Windows/F67598/main.htm

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;