This question is locked. New answers and comments are not allowed.
Hello,
After working extensively with the controls for ASP.NET, I am new to the WinForm controls. What I am looking for is a way to enable the "load on demand" functionality that is present in the Telerik radComboBox for ASP.NET.
I have a web service that I would like to use to dynamically load data in a combobox. So when the user types in some data (like "ab", I will call the webservice to find all matching items and then display them in the combobox). This is very easy to accomplish in ASP.NET, but I have been searching the forums and struggling with this for several days.
Here is the code that I have so far. This pretty much gets me what I need, but sometimes the drop down does not display the items that were loaded from the web service (I can even step through the code and see that the .Items.Count property of the combo is greater than zero, but still no drop down).
Is there a better way to handle this? Is this functionality supported out of the box? Any help is greatly appreciated.
Thanks,
Sean
After working extensively with the controls for ASP.NET, I am new to the WinForm controls. What I am looking for is a way to enable the "load on demand" functionality that is present in the Telerik radComboBox for ASP.NET.
I have a web service that I would like to use to dynamically load data in a combobox. So when the user types in some data (like "ab", I will call the webservice to find all matching items and then display them in the combobox). This is very easy to accomplish in ASP.NET, but I have been searching the forums and struggling with this for several days.
Here is the code that I have so far. This pretty much gets me what I need, but sometimes the drop down does not display the items that were loaded from the web service (I can even step through the code and see that the .Items.Count property of the combo is greater than zero, but still no drop down).
Private Sub DescriptionComboBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) |
Dim descriptionComboBoxEditor As RadComboBoxEditor = New RadComboBoxEditor |
Dim newDescription As String = Nothing |
Dim pdHelperWebService As New pdhelper.PDHelper |
Dim ds As DataSet |
Dim dt As DataTable |
Dim filter As String = Nothing |
Dim comboItem As RadComboBoxItem |
descriptionComboBoxEditor = CType(sender, RadComboBoxEditor) |
descriptionComboBoxEditor.AutoCompleteMode = AutoCompleteMode.None |
newDescription = descriptionComboBoxEditor.Text |
descriptionComboBoxEditor.Items.Clear() |
If Not String.IsNullOrEmpty(newDescription) AndAlso newDescription.Length >= 3 Then |
'Call the webservice |
ds = myWebService.GetItems(newDescription) |
dt = ds.Tables("MY_RESULTS") |
'Add each item to the combobox |
For Each item As DataRow In dt.Rows |
comboItem = New RadComboBoxItem |
comboItem.Text = item("DESCRIPTION") |
comboItem.Value = item("DESCRIPTION") |
If Not (TypeOf (item("TOOLTIP")) Is DBNull) AndAlso _ |
item("TOOLTIP") IsNot Nothing Then |
comboItem.ToolTipText = item("TOOLTIP") |
End If |
descriptionComboBoxEditor.Items.Add(comboItem) |
Next |
'Show the drop down if it's not already shown |
If Not descriptionComboBoxEditor.IsPopupOpen Then |
descriptionComboBoxEditor.ShowPopup() |
End If |
End If |
pdHelperWebService.Dispose() |
End Sub |
Is there a better way to handle this? Is this functionality supported out of the box? Any help is greatly appreciated.
Thanks,
Sean