Hi,
I have a UltraCombo control. Its AutoCompleteMode is set to None. When I click on the editor of the control, I want to display the dropdown. I tried the Click event but this event fires also when you click on the dropdown button. I am looking for an event that works specifically for the editor part of the control only. Any other event I can use to accomplish this?
Thanks,
Jason
Yeah, that's fine. It's essentially the same thing I did. My code is a little more efficient, using LastElementEntered and also a little more forgiving, since I am calling GetAncestor to get the proper UIElement. But it's unlikely to ever make any difference in the real world.
Hi Mike,
The code works perfectly. Can you take a look at the code below? It works for me too. Is it doing the right thing?
Dim clickedElement As UIElement = cboVendorName.UIElement.ElementFromPoint(New Point(e.X, e.Y))
If clickedElement IsNot Nothing AndAlso TypeOf clickedElement Is EditorWithTextUIElement Then
If Not cboVendorName.IsDroppedDown Then cboVendorName.ToggleDropdown()
Hi Jason,
Try this:
private void ultraCombo1_MouseDown(object sender, MouseEventArgs e) { UltraCombo combo = (UltraCombo)sender; UIElement element = combo.UIElement.LastElementEntered; UIElement editorWithTextUIElement = element.GetAncestor(typeof(EditorWithTextUIElement)); if (null != editorWithTextUIElement) combo.PerformAction(UltraComboAction.Dropdown); }
Yes I want to have the same behavior for both cases. If the dropdown is already dropped down and users click on the text portion, the dropdown should stay dropped down.
jason
There are two different cases you may need to deal with.
1) The control does not have focus and the user clicks on the text portion (not the dropdown button).
2) The control has focus (and is therefore showing a TextBox control over itself) and the user clicks onto the edit portion (not the dropdown button).
So my question is... do you want the same behavior in both cases?
And in the latter case, what happens if the dropdown is already dropped down? Do you want to close it? Or do nothing?