Hi
I am using the following code for multi select drop down list. I want to set default value when page gets loads.
<telerik:RadComboBox runat="server" ID="RadComboBoxProvider" AllowCustomText="true"
Text="Select" >
<ItemTemplate>
<asp:CheckBox runat="server" ID="cbProvider" AutoPostBack="true" Text='<%#Eval("First_Name")%>' />
</ItemTemplate>
</telerik:RadComboBox>
I am using the following code for multi select drop down list. I want to set default value when page gets loads.
<telerik:RadComboBox runat="server" ID="RadComboBoxProvider" AllowCustomText="true"
Text="Select" >
<ItemTemplate>
<asp:CheckBox runat="server" ID="cbProvider" AutoPostBack="true" Text='<%#Eval("First_Name")%>' />
</ItemTemplate>
</telerik:RadComboBox>
7 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 17 Nov 2011, 10:24 AM
Hello,
You can set EmptyMessage property of RadComboBox.
Thanks,
Princy.
You can set EmptyMessage property of RadComboBox.
Thanks,
Princy.
0

Maddela
Top achievements
Rank 1
answered on 17 Nov 2011, 10:29 AM
I not able to follow you properly, do you have any sample code. If you don't mind
0

Princy
Top achievements
Rank 2
answered on 17 Nov 2011, 10:54 AM
Hello,
You can try the following sample code.
ASPX:
Thanks,
Princy.
You can try the following sample code.
ASPX:
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
DataTextField
=
"FirstName"
DataValueField
=
"FirstName"
EmptyMessage
=
"Select"
Width
=
"300px"
AutoPostBack
=
"true"
>
</
telerik:RadComboBox
>
Thanks,
Princy.
0

Maddela
Top achievements
Rank 1
answered on 17 Nov 2011, 11:25 AM
No not like that, i am using multi select drop down list, and filling that from data base values, if i give radcombobox.selectedvalue=2 the value should be checked in that combobox. please look into my attached scree shot for clear understand.
0
Hello Maddela,
Can you paste here the full RadComboBox markup that you use?
Regards,
Kalina
the Telerik team
Can you paste here the full RadComboBox markup that you use?
Regards,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0

Maddela
Top achievements
Rank 1
answered on 22 Nov 2011, 12:22 PM
<telerik:RadComboBox runat="server" ID="RadComboBoxProvider" AllowCustomText="true"
Text="Select" >
<ItemTemplate>
<asp:CheckBox runat="server" ID="cbProvider" AutoPostBack="true" Text='<%#Eval("First_Name")%>' />
</ItemTemplate>
</telerik:RadComboBox>
Text="Select" >
<ItemTemplate>
<asp:CheckBox runat="server" ID="cbProvider" AutoPostBack="true" Text='<%#Eval("First_Name")%>' />
</ItemTemplate>
</telerik:RadComboBox>
0
Hi Maddela,
Let me suggest you use the RadComboBox CheckBoxes feature.
Please take a look at the “ComboBox / CheckBoxes“ online demo and the “CheckBox Support” help article.
If you want to display the texts of the RadComboBox items that have been already checked – you can easily make this by handling the OnItemDataBound event:
Then you can update the database within the OnItemChecked event handler.
I am attaching here a basic example - it is quite simple but I believe that it will help you get started your implementation.
Greetings,
Kalina
the Telerik team
Let me suggest you use the RadComboBox CheckBoxes feature.
Please take a look at the “ComboBox / CheckBoxes“ online demo and the “CheckBox Support” help article.
If you want to display the texts of the RadComboBox items that have been already checked – you can easily make this by handling the OnItemDataBound event:
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
OnItemDataBound
=
"OnItemDataBound"
AutoPostBack
=
"true"
OnItemChecked
=
"OnItemChecked"
CheckBoxes
=
"true"
>
</
telerik:RadComboBox
>
protected
void
OnItemDataBound(
object
sender, RadComboBoxItemEventArgs e)
{
RadComboBox combo = (RadComboBox)sender;
DataRowView dr = (DataRowView)e.Item.DataItem;
if
(Boolean.Parse(dr[
"Checked"
].ToString()))
{
e.Item.Checked =
true
;
}
}
Then you can update the database within the OnItemChecked event handler.
I am attaching here a basic example - it is quite simple but I believe that it will help you get started your implementation.
Greetings,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now