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

Entire row backcolor

Thread ID:

Created:

Updated:

Platform:

Replies:

59495 Apr 15,2007 09:48 AM UTC Apr 15,2007 06:07 PM UTC Windows Forms 1
loading
Tags: GridControl
Miki Watts
Asked On April 15, 2007 09:48 AM UTC

I'm using a DataBoundGrid.
I'm trying to change the backcolor of an entire row based on the value in a single cell in that row.

I've tried something like this:
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (gridDataBoundGrid1[e.RowIndex, e.ColIndex].CellValueType == typeof (string))
{
if ((string) gridDataBoundGrid1[e.RowIndex, e.ColIndex].CellValue == "001")
{
GridRangeInfo range =
GridRangeInfo.Row(e.RowIndex);


GridStyleInfo style = new GridStyleInfo();
style.BackColor = Color.Red;

gridDataBoundGrid1.Model.ChangeCells(range, style, StyleModifyType.Override);

but it causes a stackoverflow when moving out of the cell and back, and doesn't change the backcolor of the row.

What would be the standard way to do something like this?

Miki Watts
Replied On April 15, 2007 06:07 PM UTC

problem solved, thanks.

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

;