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.

change the backcolor of a row in runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

56021 Feb 8,2007 10:26 AM Feb 9,2007 02:38 PM Windows Forms 3
loading
Tags: Tools
shachar
Asked On February 8, 2007 10:26 AM

hi all.
how can i change the backcolor of a row, in run time? (let's say the third row)

Administrator [Syncfusion]
Replied On February 8, 2007 12:37 PM

Hi Shachar,

Do you want to change the selection backcolor depends on the record index? If yes, you should turn off the ListBoxSelectionColorOptions to None and handle the QueryCellInfo event of the grid to set the backcolor of the cell using e.Style.BackColor property. Here is a minimal sample that shows you "How to set the selection back color of record depends on the record rowindex?".

Sample : GGC_SummaryRow_Custom.zip

Best regards,
Haneef

Shachar Shimshon
Replied On February 9, 2007 07:13 AM

no, i want to change the backcolor of some row, not the selected row.

>Hi Shachar,

Do you want to change the selection backcolor depends on the record index? If yes, you should turn off the ListBoxSelectionColorOptions to None and handle the QueryCellInfo event of the grid to set the backcolor of the cell using e.Style.BackColor property. Here is a minimal sample that shows you "How to set the selection back color of record depends on the record rowindex?".

Sample : GGC_SummaryRow_Custom.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 9, 2007 02:38 PM

Hi Shachar,

To set style property for a particular row, you would either add a ConditionalFormat or handle QueryCellStyleInfo:

1) If you want to set style property for a row, then you can add a conditional format to the grid.TableDescriptor.ConditionaFormats collection. Please refer this sample: C:\Program Files\Syncfusion\Essential Studio\4.x\windows\Grid.Grouping.Windows\Samples\ConditionalFormatting

Here is a forum thread with another sample.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=11621


2) You can use QueryCellStyleInfo event and provide the style setting on demand there. This is useful when you want to use a particular style setting for some arbitary row in the grouping grid. Please refer to the attached sample for implementation.

Sample : GGC_RecordColor.zip

Best regards,
Haneef

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.

;