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. Image for the cookie policy date
close icon

Backgroundcolor of rows

Hi! Is there a way to change the Background Color of a specific row in a GridDataBoundGrid? regards oliver

1 Reply

AD Administrator Syncfusion Team July 13, 2003 02:30 PM UTC

Handle the PrepareViewStyleInfo event and set the backcolor there if the e.RowIndex and e.ColIndex point to a cell in the row.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
        //color row 2
	if(e.ColIndex > 0 && e.RowIndex == 2)
	{
		e.Style.BackColor = Color.Red;
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon