Hi,
i am using radcombobox and one scenrio i want that combobox having value from other sources which is working but i want that value to be shown as selected when page load not the user has to click the dropdown to see the value.
how to set the default value selected in dropdown. please help.
<telerik:RadComboBox ID="cboTaskPersonSelector" runat="server" Width="195px" Height="150px"
style="z-index: 107; left: 470px; position: absolute; top: 45px;"
EnableLoadOnDemand="True" ShowMoreResultsBox="true"
EnableVirtualScrolling="true" OnItemsRequested="cboTaskPersonSelector_ItemsRequested"
Skin="Web20" AllowCustomText="false" EnableTextSelection="true" IsCaseSensitive="false"
LoadingMessage="Loading..." DropDownWidth="500px" EnableScreenBoundaryDetection="true"
Font-Names="Tahoma" Font-Size="12px" Enabled="false"
OnClientDropDownClosed="OnClientBlur" ShowDropDownOnTextboxClick="false"
AutoPostBack="true"
OnSelectedIndexChanged="cboTaskPersonSelector_SelectedIndexChanged" SelectedValue='<%# Bind("TaskPersonId") %>'
>
</telerik:RadComboBox>
protected void cboTaskPersonSelector_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
if (e.Text.Length > 0)
{
t = TaskInfoCollection.SearchPossibleTasksForAllotmentByTitleOrNumber(e.Text);
for (int i = itemOffset; i < endOffset; i++)
{
ctl.Items.Add(new RadComboBoxItem(t[i].Number.ToString(), t[i].Id.ToString()));
}
}
else if (Request.QueryString["popup"] != null)
{
t = TaskInfoCollection.SearchPossibleTasksForAllotmentByTitleOrNumber(Request.QueryString["taskno"]);
for (int i = itemOffset; i < endOffset; i++)
{
ctl.Items.Add(new RadComboBoxItem(t[i].Number.ToString(), t[i].Id.ToString()));
}
}
}
}
here the value is fill into combo box by ctl.Items.Add() but it is not showing as selected value.
so when page load it look likes the dropdown is empty while when user click on dropdown it is there.
please help.