Hi again,
I am using an UltraComboEditor within my UltraWinGrid to display different sorts of drop-down-lists (text only, text with image or image only). For text only and text with image, positioning of the elements and displaying of the drop-down-list work fine so far.
(1)But when I want to display only images (no text, neither DisplayText nor DataValue), I would like the images to be displayed centered within the drop-down-list. I am using DropDownListAlignment.Center but without effect. I guess this is caused by the fact that the size of the actual item is limited to the size of the image (plus text) but does not span the whole width of the drop-down-list. How can I adapt to this?
(2)Furthermore, when I click a cell containing the ComboEditor and it goes into EditMode, the TextEditor is being displayed on top of my image. I would like to achieve that no TextEditor is being displayed in this case, so that the user can see the currently selected image.
(3)The whole grid has been styled. I would like to set the BackColor of the list item on which my mouse is currently over to be the same color than the BackColor of my currently selected row(s).
(4)Since the App has been designed for touch input, I would like to adapt the width of the DropDownButton.
I have been looking to adapt these features on my own, but tbh it's quite a waste of time when you don't know where to look at... I hope you can point me in the right direction :-)
weirdal said:Maybe I did not describe the issue properly. I do not want to change the BackColor of each item in the list, but I want to change the HotTrackColor of the item the mouse is currently over. I guess that is a little harder to achieve, at least I was not able to find a suitable property.
I don't think this is exposed anywhere for a ValueList. If you need to change this color, you would either have to use a DrawFilter or else use UltraCombo instead of UltraComboEditor.
weirdal said:Also, I would like to change the highlighting color of selected text in a TextEditor. Highlighted text and HotTrack color are the same color, but probably not the same property.
This is not possible. UltraTextEditor uses the TextBox control when it does into edit mode and the TextBox does not expose any way to change the selection color - it always uses the system color.
You might be able to achieve what you want using the FormattedTextEditor instead of the TextEditor, though.
(1)Fixed. Thanks Mike, am a bit stressed atm and just didn't see it.
(3)Maybe I did not describe the issue properly. I do not want to change the BackColor of each item in the list, but I want to change the HotTrackColor of the item the mouse is currently over. I guess that is a little harder to achieve, at least I was not able to find a suitable property.
Also, I would like to change the highlighting color of selected text in a TextEditor. Highlighted text and HotTrack color are the same color, but probably not the same property.
weirdal said:(1)Not fixed yet.
Why is this not fixed? The sample I posted here shows all of the images centered and there is no text displayed.
weirdal said:(3)Not fixed yet.
All you have to do for this one is apply an appearance to each item on the list. The same appearance (including the image) will be applied to the grid cell.
Hi,
thanks alot for that, Mike!
Your sample definitely brought me onto the right track for some of the issues... So, here is what I did to fix them:
(1)Not fixed yet.
(2)My mistake was to set the DropDownStyle.DropDownList property on the comboEditor instead of setting ColumnStyle.DropDownList on the column. Now works like a charm!
(3)Not fixed yet.
(4)The very same setting (ColumnStyle.DropDownList) fixed also this issue, since now the cell won't go into EditMode anymore, but drop down the list as intended. Since the list also drops down when you click on the cell rather than the buton, the need for a larger button is now obsolete.
So, all in all the essential mistake was setting these properties on the comboEditor instead of the column!
€: Oops didn't see you replied meanwhile... will look at it immediately!
Uh, my bad...
What I was trying to say is that the DataValue ofc is a string, but it's a numeric character :-) In the DB it is stored as a string, that's working fine.
When I reload the data, the string value that is loaded is correctly getting mapped into the image it should represent (means, the correct image is being displayed).
Only when I enter EditMode, an TextEditorUIElement (or something like that) is drawn over the image so that the user sees the string (numeric) value instead of the image.
I've attached a few screenshots for clarification...
Screenshot 1 shows the grid directly after it was loaded.
- Header2 = Images and text- Header3 = Just images- Header4 = Just text
As you can see from the other screenshots, behavior for 'Images and text' and 'Just text' is ok, only when I click on the DropDownButton of the 'Just images' column, the DataValue is shown in the Editor instead of the selected image.
Sorry for all the spam :-)