>Hi John,
Thank you for posting query to us.
You can use the Record.GetValue() method to retrieve the cell value of a particular column. In the QueryCellStyleInfo event, the record's value is retrieved as an object. Then compare the record value with the conditional value and assign the icon accordingly. The code for the QueryCellStyleInfo event is as follows.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null
&& e.TableCellIdentity.Column.Name == "Col2")
{
GridRecord rec = e.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
if (rec != null)
{
object val = rec.GetValue("Col1");
if (val.ToString() == "row0 col1")
{
e.Style.ImageList =this.imageList;
e.Style.ImageIndex = 0;
}
}
}
}
Please refer the below sample and let us know if this helps.
http://websamples.syncfusion.com/samples/Grid.Windows/F71064/main.htmRegards,
Jeba.
Thanks for the code sample.
My program has reference to all the rows of 40 columns using a hashtable where the key is the stock code and the value is the row in the datagrid as mentioned.
Now given a stock quote i need to quickly obtain the cell reference based on the column name (for the given row) so i could set the exception when there is a wrong value. Could you please tell me how to go about it?
Thanks
John