Hi Rekha,
Thanks for your interest in Syncfusion products.
There is no direct way to achieve you requirement. But you can do this by a workaround. Please refer the following steps to be done:
1. We have to loop through the Grid data and access the value of each cell.
2. We have to compare the Rice and Wheat values based on the Comapny
3. Based on the comparision just save the Rice values which are going to be highlighted, in a collection.
4. In QueryStyleCellInfo event just check for the values in the collection and set the BackColor for the particular cell.
Please refer the below code snippet which illustrates this:
protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if ( e.TableCellIdentity.TableCellType == Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellTypeRecordFieldCell )
{
if (e.TableCellIdentity.Column.Name == "Price on Jun 1")
{
foreach (Rice obj1 in ric1)
{
if (e.Style.Text == obj1.rice1.ToString())
{
e.Style.BackColor = Color.Red;
}
}
}
if (e.TableCellIdentity.Column.Name == "Price on Jun 2")
{
foreach (Rice_nxtmnth obj1 in ric2)
{
if (e.Style.Text == obj1.rice1.ToString())
{
e.Style.BackColor = Color.Red;
}
}
}
}
}
Please refer the sample from the below link which illustrates the above:
http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Grid_ASP_Bkcolor/main.htmPlease let me know if you have any other concerns.
Regards,
Raji