Hello out there,
I have an ComboBox which is connected to a DataSet with small Images (and an hidden value column).
If I press the Button on the ComboBox, the images are show and I can select one.
But, when I do this, the Image is not shown in the Combobox, but it's type: System.Drawing....
How can I modifiy the ComboBox to show my Images?
Thanks,
Frank
Hi Frank,
I think you will need to use UltraComboEditor for this instead of UltraCombo.
Assuming you bind the UltraComboEditor to some data source, you would loop through the items in the list and assign an Appearance.Image to each one. Then you tell the list to display the images by setting:
this.ultraComboEditor1.Items[0].ValueList.DisplayStyle = ValueListDisplayStyle.Picture;
I set up an UltraComboEditor as described (except it's not bound -- I initialize a static list) and made it the EditorControl of a column in a tree. The tree has an image list, and the column data values are integer indices into it. The tree is initially displayed correctly.
The editor dropdown arrow is always visible (OK for now, though I'd like it to appear on hover as in the "grid with editors" sample).
When I open the dropdown list (only images are shown -- good), the image in the cell disappears. It should stay the same until I change it.
When I change it by clicking an item in the list, the list closes up but there is still no image in the cell. If I exit the application without any further action, there is an invalid index exception in Dispose(). If I instead click outside the tree, the old image appears and no exception occurs on app exit.
I subscribed to the editor's SelectionChanged, ValueChanged, and SelectionChangeCommitted events, but none of them are ever fired. (I verified that the lines of code doing the subscriptions do get executed).
Any ideas, either on how to get the editor to work, or on how to debug (i.e. why I'm not seeing events)?
By the way, are there any books on using Infragistics components?
Hi Mike,
I could not figure out how to do this with the ultraComboEditor, but I have now a solution with the ultraCombo.
I put an onChange-Event on it and change then the Image of the displayed Item. This works very good.
Thank you for the idea,