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.
Syncfusion Feedback

GGC: Row Highlight

Thread ID:

Created:

Updated:

Platform:

Replies:

68434 Sep 21,2007 10:19 AM UTC Sep 24,2007 11:33 AM UTC Windows Forms 1
loading
Tags: Grouping
Patrick Cheng
Asked On September 21, 2007 10:19 AM UTC

Hi,

I want to be able to highlight a row with the exception of one column. This column will have a color associated with it based on some parameter, so I do not want the color to be override by the highlighting when I select that row. In other words, I want the entire row to be highlighted, for example in yellow, but this column remain its original color, for example blue.

Thanks in advanced!

Golda Rebecal [Syncfusion]
Replied On September 24, 2007 11:33 AM UTC

Hi Patrick,

You can highlight a row except one column by checking the appropriate column index and applying style in the PrepareViewStyleInfo event.

void TableControl_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
GridControlBase grid = this.gridGroupingControl1.TableControl;
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;

// Highlight the current row with yellow color and bold font
if (e.RowIndex > grid.Model.Rows.HeaderCount && e.ColIndex > grid.Model.Cols.HeaderCount
&& cc.HasCurrentCellAt(e.RowIndex) && e.ColIndex != 3)
{
e.Style.Interior = new BrushInfo(Color.Yellow);
e.Style.TextColor = SystemColors.HighlightText;
e.Style.Font.Bold = true;
}
else if (e.ColIndex == 3)
e.Style.Interior = new BrushInfo(Color.Blue);
}

Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Grid.Windows/F68434/main.htm

Kindly let me know if this helps you.

We appreciate your interest in Syncfusion products.

Best regards,
Golda

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

;