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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chnging Color in single cell or row.

Thread ID:

Created:

Updated:

Platform:

Replies:

94768 Jun 1,2010 09:46 AM UTC Aug 13,2010 09:09 AM UTC WinForms 5
loading
Tags: GridControl
Michael
Asked On June 1, 2010 09:46 AM UTC

Hi.
How can I change background color in the GridListControl for the single cell or row ?

gridListControl1.Grid[rowindex, colindex].BackColor = Color.FromArgb(((System.Byte)(255)), ((System.Byte)(0)), ((System.Byte)(0))); - doesn't work

Jisha Joy [Syncfusion]
Replied On June 2, 2010 04:54 AM UTC

Hi Michael,

You need to handle Grid.QueryCellInfo event of GridListControl to apply styles to the grid cells.

this.gridListControl1.Grid.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Grid_QueryCellInfo);

void Grid_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
if (e.RowIndex == 2 && e.ColIndex == 2)
e.Style.BackColor = Color.PaleGoldenrod;
}


Please let me know if this helps.

Regards,
Jisha

Michael
Replied On June 3, 2010 10:08 AM UTC

Thank you Jisha.
It's works perfect.

Jisha Joy [Syncfusion]
Replied On June 4, 2010 03:46 AM UTC


Hi Michael,

Thank you for your update.

Regards,
Jisha

Alexey Usanov
Replied On August 12, 2010 10:11 AM UTC

Dear Jisha,
is it possible to access GridControl in GridDataBoundGrid? There is no such propery as Grid here.

Jisha Joy [Syncfusion]
Replied On August 13, 2010 09:09 AM UTC

Hi Alexy,

You could achieve the desired behavior by handling the Model.QueryCellInfo event.

this.gridDataBoundGrid.Model.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Grid_QueryCellInfo);

void Grid_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
if (e.RowIndex == 2 && e.ColIndex == 2)
e.Style.BackColor = Color.PaleGoldenrod;
}

Regards,
Jisha

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.

Warning Icon 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.Close Icon

;