Hello guys,
I have a problem with the Prometheus combobox when trying to set a datasource dynamically. Here how I'm set up: I have a combo box that is part of an update panel and the combo box list of items can be very very long (many thousands items). Since I dont want to transfer all these items (accessed by web service) and set it to the combobox datasource, I'm trying to set the datasource in the OnItemsRequested server side method when the user type 3 or more charaters in the combobox (the allow custom text is set to true and when there is 3 characters or more that are typed, in the OnItemsRequested method I call the web service and set the datasource).
The server side code that set the datasource id very simple, it looks like this:
try
{
RadComboBox combo = (RadComboBox)o;
combo.Items.Clear();
conditionDTO[] dtos = searchConditions(e.Text);
if (dtos != null)
{
foreach (conditionDTO dto in dtos)
{
RadComboBoxItem item = new RadComboBoxItem(dto.name);
item.Value = dto.code.ToString();
combo.Items.Add(item);
}
}
combo.DataSource = dtos;
combo.DataBind();
((UpdatePanel)Page.FindControl("UpdatePanelPop")).Update();
}
I make a call to the web service, set the datasource to the combobox, call databind and update my update panel. On the UI, the dropdown contains the proper items, but if I select one from the list and do a callback, the SelectedItem on the combobox is always null (and the combobox datasource also).
Here's what the combobox definition looks like:
<telerik:RadComboBox Width="239px" Height="200px" EnableEmbeddedSkins="False" ID="selNoBlankPatientConditions" AllowCustomText="true" runat="server" DataTextField="name" DataValueField="code" EnableLoadOnDemand="true" MarkFirstMatch="True" MaxLength="50" OnItemsRequested="conditions_ItemsRequested" Text="Type or select your condition here..." >
<CollapseAnimation Duration="200" Type="OutQuint" />
<ExpandAnimation Type="OutQuart" />
</telerik:RadComboBox>
I really need help on this one!
Thx,
Phil
I have a problem with the Prometheus combobox when trying to set a datasource dynamically. Here how I'm set up: I have a combo box that is part of an update panel and the combo box list of items can be very very long (many thousands items). Since I dont want to transfer all these items (accessed by web service) and set it to the combobox datasource, I'm trying to set the datasource in the OnItemsRequested server side method when the user type 3 or more charaters in the combobox (the allow custom text is set to true and when there is 3 characters or more that are typed, in the OnItemsRequested method I call the web service and set the datasource).
The server side code that set the datasource id very simple, it looks like this:
try
{
RadComboBox combo = (RadComboBox)o;
combo.Items.Clear();
conditionDTO[] dtos = searchConditions(e.Text);
if (dtos != null)
{
foreach (conditionDTO dto in dtos)
{
RadComboBoxItem item = new RadComboBoxItem(dto.name);
item.Value = dto.code.ToString();
combo.Items.Add(item);
}
}
combo.DataSource = dtos;
combo.DataBind();
((UpdatePanel)Page.FindControl("UpdatePanelPop")).Update();
}
I make a call to the web service, set the datasource to the combobox, call databind and update my update panel. On the UI, the dropdown contains the proper items, but if I select one from the list and do a callback, the SelectedItem on the combobox is always null (and the combobox datasource also).
Here's what the combobox definition looks like:
<telerik:RadComboBox Width="239px" Height="200px" EnableEmbeddedSkins="False" ID="selNoBlankPatientConditions" AllowCustomText="true" runat="server" DataTextField="name" DataValueField="code" EnableLoadOnDemand="true" MarkFirstMatch="True" MaxLength="50" OnItemsRequested="conditions_ItemsRequested" Text="Type or select your condition here..." >
<CollapseAnimation Duration="200" Type="OutQuint" />
<ExpandAnimation Type="OutQuart" />
</telerik:RadComboBox>
I really need help on this one!
Thx,
Phil