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.

Image index problem in Grid List control

Thread ID:





70186 Nov 30,2007 05:35 AM Nov 30,2007 08:43 AM Windows Forms 1
Tags: GridControl
Asked On November 30, 2007 05:35 AM

I have grid list control with imagelist set. I'm filling the list with object datasource. i found that image column takes the index of the property called ImageIndex in object datasource. But i want that each row takes the image based on value of some other property.How will i do this?

Please find the attached sample application.
I have two grid list control in this application-glcSource and GLCOutput. i'm filling both these grid with same list object.

In case of glcSource i want the image for each row should be based on ImageIndex property in the clsData class which i have declared. And in case of GLCOutput i want the image for each row based on the value of 'Status' property in clsData class.

Please help me out with this problem.



Administrator [Syncfusion]
Replied On November 30, 2007 08:43 AM

One way you can do this is to subscribe to the QueryCellInfo event on the embedded GridControl and swap the values there.

//subscribe to the event in btnFilldata_Click
GLCOutput.Grid.QueryCellInfo += new GridQueryCellInfoEventHandler(Grid_QueryCellInfo);

//the event code
void Grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
if (e.ColIndex == 1 && e.RowIndex > 0)
e.Style.ImageIndex = lstData[e.RowIndex - 1].Status;


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.

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.