I am using RadCombobox with EnableLoadOnDemand="true" Option , its working fine.I have Clear Button in the same page ,After clicking on Clear Button i need to display default item in combobox.
I saw solution for the same requirement , but thats not working .
Following is Aspx Code :
<telerik:RadComboBox ID="RadComboBox1" runat="server"
<asp:Button ID="btnSubmit" runat ="server" Text ="Clear" OnClick ="btnSubmit_click"/>
Following is Csharp Code :
protected void Page_Load(object sender, EventArgs e)
DataTable dataTable = CreateDataSource();
foreach (DataRow dataRow in dataTable.Rows)
RadComboBoxItem item = new RadComboBoxItem();
item.Text = (string)dataRow["Name"];
item.Value = dataRow["ID"].ToString();
// preselect the second item
//RadComboBox1.SelectedValue = "0";
RadComboBox1.Items.Selected = true;
protected DataTable CreateDataSource()
DataTable dataTable = new DataTable();
dataTable.Columns.Add(new DataColumn("ID", typeof(string)));
dataTable.Columns.Add(new DataColumn("Name", typeof(string)));
DataRow dr = dataTable.NewRow();
dr["ID"] = "0";
dr["Name"] = "SELECT NAME";
DataRow dr1 = dataTable.NewRow();
dr1["ID"] = "1";
dr1["Name"] = "Name1";
DataRow dr2 = dataTable.NewRow();
dr2["ID"] = "2";
dr2["Name"] = "Name2";
DataRow dr3 = dataTable.NewRow();
dr3["ID"] = "3";
dr3["Name"] = "Name3";
protected void btnSubmit_click(object sender, EventArgs e)
RadComboBox1.Items.Selected = true;
9 Answers, 1 is accepted
Based on your code and logic, I presume that the selecteditem text is not showing even if the item is selected. Have you tried setting the Text explicitly to overcome this?
Give a try with the following code and let me know if you need further assistance.
i have a Telerik:RadCombobox but i am having some difficulty trying to do something which i am to believe is rather simple, let me paste some code for you
ok so not that its not working, it does, the thing is when i look at this combobox, i have 3 values
So when the page loads i want the user to see "Select Action" as a default
so when he clicks on the combobox he can choose Append or override, i do not want the user to be able to select the option "Select Action" or see it as an item, i just want that as an indicator in the combobox to say that here they must select an action, once they have selected an action i don't want them to be able to select "Select Action"
so put easy for you
there should only be 2 values that can be selected, but when the page loads i want the combobox to show me "Select Action" but in reality it must not be select-able
Please Help, Please please
The default behavior of RadComboBox is that it will not allow to select the EmptyMeaasge. In your scenario you have set 'Select Action' as the EmptyMeassage so it will not be available in the dropdownlist and the 'Select Action' will show only at first time.
Please elaborate your requirement if it doesn't help.
<telerik:RadComboBox ID="ActionRadCombo" TabIndex="20" runat="server" Text="Select Action" EmptyMessage="Select Action" Skin="Outlook">
<telerik:RadComboBoxItem Visible="False" Text="" Value="-1" IsSelected="true" runat="server" />
<telerik:RadComboBoxItem Text="Append" Value="1" runat="server" />
<telerik:RadComboBoxItem Text="Override" Value="2" runat="server" />
Hi. New to Telerik controls, fyi.
I'm unable to "title" the RadComboBox by using the aspnet method described here: https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/radcombobox-items/default-item.
Here's my setup:
I had the <DefaultItem> just above <Items> in the RadComboBox, like so:
And now is when I realize I'm a dummy. There is no data at this point. So, my question is changing to: Can I put a "placeholder" as a default name for the box?
The "placeholder" for the RadComboBox is set via the EmptyMessage property
<telerik:RadComboBox ID="RadComboBox1" EmptyMessage="Placeholder text here..." runat="server" RenderMode="Lightweight"> <Items> <telerik:RadComboBoxItem Text="Item 1" /> <telerik:RadComboBoxItem Text="Item 2" /> <telerik:RadComboBoxItem Text="Item 3" /> <telerik:RadComboBoxItem Text="Item 4" /> </Items> </telerik:RadComboBox>