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

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

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

9 Replies

AD Administrator Syncfusion Team 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.


NB Neil B Breeden III 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. >


AD Administrator Syncfusion Team 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).


NB Neil B Breeden III 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!


AD Administrator Syncfusion Team 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


NB Neil B Breeden III 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!


AD Administrator Syncfusion Team 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! >


MD Michael Dominik 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! >>


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon