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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Image index problem in Grid List control

Thread ID:

Created:

Updated:

Platform:

Replies:

70186 Nov 30,2007 10:35 AM UTC Nov 30,2007 01:43 PM UTC WinForms 1
loading
Tags: GridControl
Arun
Asked On November 30, 2007 10:35 AM UTC

Hi
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.

Thanks
ak



GridListTest_imageIndex.zip

Administrator [Syncfusion]
Replied On November 30, 2007 01:43 PM UTC

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;
}
}



CONFIRMATION

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.

Warning Icon 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.Close Icon

;