Hi,
I'm trying to implement a combobox which should dynamically load and display some data from a xml-file.
In debugger I can see that the data is loaded correctly and is added to the combobox-control via RadComboBox1.Items.Add(...).
But afterwards nothing is displayed in the combobox - the box still remains displaying "Loading..."
The Data I'm expecting is:
"", "" (empty Strings)
"data1", "data1"
"data2", "data2"
"data3", "data3"
"data4", "data4"
Here's the code of the combobox-control in my .aspx-file:
Here is what is done on the server in my .aspx.vb-file:
Does somebody has an idea or hint on what I'm doing wrong?
Kind regards,
Torben
I'm trying to implement a combobox which should dynamically load and display some data from a xml-file.
In debugger I can see that the data is loaded correctly and is added to the combobox-control via RadComboBox1.Items.Add(...).
But afterwards nothing is displayed in the combobox - the box still remains displaying "Loading..."
The Data I'm expecting is:
"", "" (empty Strings)
"data1", "data1"
"data2", "data2"
"data3", "data3"
"data4", "data4"
Here's the code of the combobox-control in my .aspx-file:
| <telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="True" EmptyMessage="Choose Data" EnableLoadOnDemand="True" ShowMoreResultsBox="true" |
| EnableVirtualScrolling="true" Filter="StartsWith" AutoPostBack="True" DataTextField="Name" DataValueField="Name"> |
| </telerik:RadComboBox> |
Here is what is done on the server in my .aspx.vb-file:
| Protected Sub RadComboBox1_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles RadComboBox1.ItemsRequested |
| Dim data As DataTable = GetData(e.Text) |
| Dim itemOffset As Integer = e.NumberOfItems |
| Dim endOffset As Integer = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count) |
| e.EndOfItems = endOffset = data.Rows.Count |
| For i As Integer = 0 To data.Rows.Count - 1 |
| RadComboBox1.Items.Add(New RadComboBoxItem(data.Rows(i)("Name").ToString(), data.Rows(i)("Name").ToString())) |
| Next |
| e.Message = GetStatusMessage(endOffset, data.Rows.Count) |
| End Sub |
Does somebody has an idea or hint on what I'm doing wrong?
Kind regards,
Torben