This is a migrated thread and some comments may be shown as answers.

Multiselection dropdown, Default Text

4 Answers 77 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
RK
Top achievements
Rank 1
RK asked on 04 Apr 2011, 05:08 PM

 

 

Hi,

I'm displaying a Combobox with multiple item selection by means of a checkbox. Does not allow custom text. The problem is that the default text displays always the first item. Is there any way to display the default text as blank or a custom text (by not setting the 'Allow Custom Text' property to true?)

Thanks.

<
telerik:RadComboBox ID="RCBRegion" runat="server" Width="100px"

 

 

 

Text="Select Region" DataTextField="Region" DataValueField="Region"

 

 

 

Skin="Web20">

 

 

 

<HeaderTemplate>

 

 

 

<table style="width: 115px">

 

 

 

<tr>

 

 

 

<td style="width: 115px;">

 

 

 

<asp:LinkButton ID="hlSelectAllRegions" runat="server" Text="Selection" onclick="hlSelectAllRegions_Click" ></asp:LinkButton>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</HeaderTemplate>

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox runat="server" ID="CheckBox1" Text=' <%# DataBinder.Eval(Container.DataItem, "Region")%>' />

 

 

 

</ItemTemplate>

 

 

 

 

</telerik:RadComboBox>

 

4 Answers, 1 is accepted

Sort by
0
Andy Green
Top achievements
Rank 2
answered on 04 Apr 2011, 07:41 PM
In the control markup use - emptyMessage="Click to change Values"

or in the code behind use - RCBRegion.emptyMessage ="Click to change Values"

Andy
0
RK
Top achievements
Rank 1
answered on 04 Apr 2011, 07:53 PM
No Andy, I tried that already. No luck.
0
Andy Green
Top achievements
Rank 2
answered on 04 Apr 2011, 08:14 PM
OK, Here are 2 more things you can try.

When the control is created use something like - RCBRegion.Items.Add(New RadComboBoxItem("Your Value Here", 0))

or

in the data query, add a data item at the top. You can do this with a Select....... Union Select...Your query

I have a problem with checkboxes in a combo box, but my markup works - http://www.telerik.com/community/forums/aspnet-ajax/combobox/check-boxes-in-combo-box.aspx


Andy
0
Kate
Telerik team
answered on 06 Apr 2011, 05:15 PM
Hello rk,

Please take a look at the following help topic: Using the EmptyMessage Property.

Kind regards,
Kate
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
RK
Top achievements
Rank 1
Answers by
Andy Green
Top achievements
Rank 2
RK
Top achievements
Rank 1
Kate
Telerik team
Share this question
or