I have a radComboBox in a usercontrol within a RadGrid.
The combo box contains a list of approx 3000 clients, so I have set EnableAutomaticLoadOnDemand = true so that when open the usercontrol, the load time of the form is quite fast.
This works well for adding new records, however when I am trying to edit a record which already has a client set, the SelectedValue property will fail to pick the value from the list (as I guess it hasn't been loaded yet). As soon as I revert to the default of EnableAutomaticLoadOnDemand = false as shown in my code snippet below, then the SelectedValue property will correctly set the value from the list, but this then takes a couple of seconds to load the combo data.
Is there any way that I can set EnableAutomaticLoadOnDemand = true, while also getting the SelectedValue property to set the correct value from the data source? (As an added complication, I also have a "Select from Template" combo box which will set various values in other text boxes and combo boxes, which I would also like to use with EnableAutomaticLoadOnDemand = true.)
Thanks for your help,
Ben
The combo box contains a list of approx 3000 clients, so I have set EnableAutomaticLoadOnDemand = true so that when open the usercontrol, the load time of the form is quite fast.
This works well for adding new records, however when I am trying to edit a record which already has a client set, the SelectedValue property will fail to pick the value from the list (as I guess it hasn't been loaded yet). As soon as I revert to the default of EnableAutomaticLoadOnDemand = false as shown in my code snippet below, then the SelectedValue property will correctly set the value from the list, but this then takes a couple of seconds to load the combo data.
Is there any way that I can set EnableAutomaticLoadOnDemand = true, while also getting the SelectedValue property to set the correct value from the data source? (As an added complication, I also have a "Select from Template" combo box which will set various values in other text boxes and combo boxes, which I would also like to use with EnableAutomaticLoadOnDemand = true.)
Thanks for your help,
Ben
<tr>
<td>
Client
</td>
<td>
<telerik:RadComboBox ID="cboClient" Runat="server" AllowCustomText="true"
DataSourceID="SqlDataSource1" DataTextField="Account" DataValueField="ClientID"
Skin="Outlook"
SelectedValue='<%# DataBinder.Eval( Container, "DataItem.ClientID") %>'
Width="320px" EnableVirtualScrolling="True"
Filter="Contains" ItemsPerRequest="20" ShowMoreResultsBox="True">
<itemtemplate>
<table style="width:300px">
<tr>
<td style="width:100px; text-align: left;">
<%
#DataBinder.Eval(Container.DataItem, "Account")%>
</td>
<td style="width:200px; text-align: left;">
<%
#DataBinder.Eval(Container.DataItem, "Disp")%>
</td>
</tr>