I have a scenario where the UI looks like this:
[textbox] [textbox] [textbox] [ultracombo]
I am using the ultracombo which has 3 columns. When a user selects a row, I fill out the textboxes.
Is there a way to only show the "down arrow" for the combobox or a button which opens up the combo box?
My current workaround is to resize the ultracombo to only show the down arrow, but then the position where the dropdown displays is off
Hi,
There's no way to remove the text portion of the Combo. What you are doing, sizing the control so that only the button shows up, is probably the best way to do what you want here.
In addition, you probably also want to set the DropDownStyle on the Combo to DropDownList. This way, it will never allow the user to edit the text.
Another option might be to use a different control, like UltraDropDownButton with a PopupControlContainer. Basically, this would give you the ability to have a button that drops down any control you want. In this cause, you could use a WinGrid.
One more scenario that popped out.
Once I select an item from the dropdown, that item appears as selected. Is there a way to "unselect" the item after selecting it? I am not able to find a selectedindex property or something like that. My code looks like this:
Private Sub SizeUltraCombo_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SizeUltraCombo.ValueChanged
Dim list As Infragistics.Win.IValueList = SizeUltraCombo
Dim index As Integer
list.GetText(SizeUltraCombo.Value, index)
If (index >= 0) Then
Dim dimensionVal = SizeUltraCombo.Rows(index).Cells("Dimension").Value
SizeTextBox.Text = CStr(dimensionVal)
SizeTextBox.Focus()
End If
End Sub
TB_2563 said:Once I select an item from the dropdown, that item appears as selected. Is there a way to "unselect" the item after selecting it?
I'm afraid you lost me here. I don't know what you mean. Why would you want the item to be immediately de-selected after the user selects it? What would be the point?
The code you have here doesn't seen to have anything to do with selection, so I'm really not sure what you are trying to do.
Basically I am using the combobox to fill out a set of textboxes in the valuechanged event. That is what the sample code is doing. The problem is if the user changes the textbox values and they click again on the combobox, the value previously selected in the combobox is still selected. So if they want to use the same entry, the value changed event doesn't fire and the texboxes don't get fill in.
Okay, then what you need to do is set the Value of the control to Null. I'd probably use the TextChanged event of the TextBoxes to do it, rather than trying to do it immediately after a value is selected. You will also probably need to account for nulls in the ValueChanged event of the combo, of course.