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 : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I add images as values to a combo box in a grid grouping control?

Thread ID:

Created:

Updated:

Platform:

Replies:

35609 Oct 5,2005 08:03 AM UTC Oct 13,2005 04:20 PM UTC WinForms 9
loading
Tags: Grouping
Neil B Breeden III
Asked On October 5, 2005 08:03 AM UTC

All, I need to create a several combo boxes in various columns which will render a list of images instead of text. I can not find any example code or figure out how to accomplish this task. Any help would be much appreciated. Thanks! -Neil

Administrator [Syncfusion]
Replied On October 5, 2005 01:42 PM UTC

One way you can do this is to drop a GridListControl cell. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GGC_GLC_Images_3659f4e.zip If you need more control (like do not want the text and just see the image, or wnat to center the image, etc), then you can subscribe to the DrawCell event on the embedded grid in the dropdown, cr.ListControlPart.Grid, and just draw the image there yourself.

Neil B Breeden III
Replied On October 5, 2005 11:46 PM UTC

Hi, I wasn''t able to get the example to work as expected. My grouping grid has a datasource assigned to it already, what I need to do is make one of the cells a combo box then drop several icons/images into the combo box. I believe the datasource will be providing a number which would be the index for the list of icons/images in the combo box. Any other ideas on how I can accomplish this? Thanks -Neil >One way you can do this is to drop a GridListControl cell. Here is a little sample. > >http://www.syncfusion.com/Support/user/uploads/GGC_GLC_Images_3659f4e.zip > >If you need more control (like do not want the text and just see the image, or wnat to center the image, etc), then you can subscribe to the DrawCell event on the embedded grid in the dropdown, cr.ListControlPart.Grid, and just draw the image there yourself. >

Administrator [Syncfusion]
Replied On October 6, 2005 12:54 AM UTC

I think the above sample does exactly what you described. It has a datatable (named dt) that has a column that holds an imageindex number. This would be your existing DataTable that you already have. Additionaly, you would create a second DataTable (which you currently do not have) called dropTable in the sample. In this second table, you would have 2 columns, one named ImageIndex and the other named something else just like in the sample code. You would also have to create an imagelist as in the sample code holding the images that you want to use (in the order required by the column of integers in your original DataTable).

Neil B Breeden III
Replied On October 6, 2005 08:10 AM UTC

Hi Clay, I implemented your example code and I am getting this exception thrown when I click the drop down button to display the contents of the combo box: (Please ignore the namespaces, we have created a bunch of custom stuff). PInvokeStackImbalance was detected Message: A call to PInvoke function ''Microsoft.CustomForms.Common.Shared.Base!Microsoft.CustomForms.Common.Runtime.InteropServices.NativeMethods::ImageList_DrawEx'' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. The line of code that is causing the exception is: cr.ListControlPart.ImageList = list; in the gridGroupingControl1_TableControlCurrentCellShowingDropDown event. If I comment out the line then the drop down will render a table that appears to be the datasource columns. Any ideas? Thanks for all the help!

Administrator [Syncfusion]
Replied On October 6, 2005 11:30 AM UTC

Are you using VS 2005? This particular problem has been seen and corrected on that platform. But here is a simpler solution. It uses a foreign key relation to handle looking up the bitmap in a drop down. http://www.syncfusion.com/Support/user/uploads/GGC_GLC_Images_2226e59c.zip

Neil B Breeden III
Replied On October 6, 2005 07:54 PM UTC

Hi, Yup, this is being developed in VS2005. Was there a specific update that solved this issue? if so is there a KB article or what date was this fixed? I think we are using the 3.2 base and I know the 3.3 build is available we just haven''t updated yet. Once again thanks for all the help!

Administrator [Syncfusion]
Replied On October 10, 2005 01:26 AM UTC

Hi Neil, there is no public patch with this fix. We only found out about it recently. So even with the 3.3 release the problem will be in there with VS 2005. Stefan >Hi, > >Yup, this is being developed in VS2005. > >Was there a specific update that solved this issue? if so is there a KB article or what date was this fixed? I think we are using the 3.2 base and I know the 3.3 build is available we just haven''t updated yet. > >Once again thanks for all the help! >

Michael Dominik
Replied On October 13, 2005 03:52 PM UTC

I''m also experiencing the pinvokestackimbalance problem in VS 2005. How do we get the fix if it is not public? Mike >Hi Neil, > >there is no public patch with this fix. We only found out about it recently. So even with the 3.3 release the problem will be in there with VS 2005. > >Stefan > >>Hi, >> >>Yup, this is being developed in VS2005. >> >>Was there a specific update that solved this issue? if so is there a KB article or what date was this fixed? I think we are using the 3.2 base and I know the 3.3 build is available we just haven''t updated yet. >> >>Once again thanks for all the help! >>

Administrator [Syncfusion]
Replied On October 13, 2005 04:20 PM UTC

You can submit a Direct Trac support incident and request a private patch. We will try to accomodate you.

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

;