Multiselection dropdown, Default Text

5 posts, 0 answers
  1. RK
    RK avatar
    18 posts
    Member since:
    Oct 2011

    Posted 04 Apr 2011 Link to this post

     

     

    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>

     

  2. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 04 Apr 2011 Link to this post

    In the control markup use - emptyMessage="Click to change Values"

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

    Andy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. RK
    RK avatar
    18 posts
    Member since:
    Oct 2011

    Posted 04 Apr 2011 Link to this post

    No Andy, I tried that already. No luck.
  5. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 04 Apr 2011 Link to this post

    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
  6. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 06 Apr 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017