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

Syncfusion grid click and corresponding image is show ? (Sagar)

Dear Sir
I am facing a problem in syncfusion grid.
If I am click any row then corresponding image will display.
Example
In grid 3 item a, b, c.
If we click a row then an image show other wise another image.
Please immediate reply on this mail.
Am waiting your reply......
Sagar

1 Reply

JS Jeba S Syncfusion Team October 26, 2007 08:54 AM UTC

Hi Asit,

Sorry for the delay in response.

You can assign different images while clicking the row by handling CellClick and QueryCellInfo events. You can check the corresponding RowIndex and assign the Style.ImageIndex property in the QueryCellInfo event.

Please refer this code snippets:

private void gridControl1_CellClick(object sender, GridCellClickEventArgs e)
{
cc = this.gridControl1.CurrentCell;
if (cc.RowIndex == 5 && cc.ColIndex == 3)
{
flag1 = !flag1;
cc.Refresh();
}
if (cc.RowIndex == 6 && cc.ColIndex ==3)
{
flag2 = !flag2;
cc.Refresh();
}
if (cc.RowIndex == 7 && cc.ColIndex == 3)
{
flag3 = !flag3;
cc.Refresh();
}
}

private void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex > 0 && e.ColIndex > 0)
{
if (e.RowIndex ==5 && e.ColIndex == 3 && flag1 == true )
{
e.Style.ImageIndex = 3;
}
}
if (e.RowIndex == 6 && e.ColIndex == 3 && flag2 == true)
{
e.Style.ImageIndex = 0;
}
if (e.RowIndex == 7 && e.ColIndex == 3 && flag3 == true)
{
e.Style.ImageIndex = 1;
}
}


Please refer this sample which implements the above said feature.
http://websamples.syncfusion.com/samples/Grid.Windows/F68648/main.htm

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

Loader.
Live Chat Icon For mobile
Up arrow icon