Hello All...
I have a combobox which is filled on demand (by ItemsRequested). On page load, I need to fill the combobox initially with some value (which exists on the items that will be filled if ItemsRequested fired)..
Let's say I have the following code snippet for ASPX
| <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager> |
| <telerik:RadComboBox ID="cmbo" runat="server" AutoPostBack="true" EnableLoadOnDemand="true"></telerik:RadComboBox> |
And I have a method: cmbo_ItemsRequested which handles cmbo.ItemsRequested, this methods (for simplicity) fills the combobox with 100 items in the form: '#-Item' and the value of #
| Protected Sub cmbo_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles cmbo.ItemsRequested |
| cmbo.Items.Clear() |
| For i As Integer = 1 To 100 |
| cmbo.Items.Add(New RadComboBoxItem(i & "-Item", i)) |
| Next |
| cmbo.DataBind() |
| End Sub |
And on Page Load I need to fill the combobox initially with some value (Let's say "5-Item")
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| If Not Page.IsPostBack Then |
| cmbo.Items.Add(New RadComboBoxItem("5-Item")) |
| End If |
| End Sub |
After running this code:
On page load, "5-Item" is displayed on the combobox. Clearing the text of the combobox will open the combobox and the combobox will be filled the combobox with the 100 items, now select any item (for example: "10-Item") , the combobox will be closed, reopen the combobox, the only item will be displayed in the items list is "5-Item" (as the snapshot attached)...
What I need is to display all items after selecting "10-Item"....
What I need is to display all items after selecting "10-Item"....
PS: You may ask why I didn't use LoadOnDemand feature provided from Telerik....that's because I don't need to load ALL items on page load, because the method cmbo_ItemsRequested makes a query from database and depending on the entered text in the combobox it retrieves the data (I have thousands of records to be filled) also I have about 5 other comboboxes like this one on the same page, so filling it with all data on page load will not be effecient (will be slow)..
Note: I am using version: 2009.1.402.35 , and IE7 (I tried the latest version of Telerik, but it didn't fix the issue)
I am waiting any suggestion ASAP...
Thank you.