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

Rad Combo Box with MultiSelect Checkbox and Empty Text Message

3 Answers 657 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
saravanan k
Top achievements
Rank 1
saravanan k asked on 16 Apr 2010, 03:57 PM
I am using Telerik's rad combo box with checkbox as in http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx

How can I provide a 

A)  Select All(as a label and not as a checkbox)  feature to that  demo?

I am using the code

Asp .NET Page

<telerik:RadComboBox ID="radBox" runat="server" EmptyMessage="Please Select" HighlightTemplatedItems="True"

AllowCustomText="True" OnClientDropDownClosed="onDropDownClosing"

Skin="Office2007">

<ItemTemplate>

<div onclick="StopPropagation(event)">

<asp:CheckBox runat="server" ID="selectBox" checked="false"

onclick="onBoxClick(this)" Text='<%#DataBinder.Eval(Container,"Text")%>'/>

In Cs File

protected void DataBind(){
//Code Omitted

radBox.DataSource = NameList;

radBox.DataValueField = "Id";

radBox.DataTextField = "Text";

radBox.DataBind();

}
Currently If I add a Select All as my List Item its coming as a Checkbox feature,I need to Select All the items on the first item click (How can I include that feature?)  and not get that added as a text when selecting .

B) One more feature I would like to have is to limit the user not to enter any invalid characters in the Select All but keep the Empty Message string?

How can I bring that functionality apart  from the one specified over here..(That is disabling the keypress)  in http://www.telerik.com/community/forums/aspnet-ajax/combobox/how-can-i-show-a-message-at-the-top-of-combobox-like-choose-an-item.aspx 

and here( where the empty client side text wont have the Italic Silver style for Rad Combo box)

http://www.telerik.com/community/forums/aspnet-ajax/combobox/set-radcombobox-to-empty-clientside.aspx


The  exact problem I am facing here is :

I have normal drop down checkbox
and the Multiselect checkbox in One page.

When I set the style for Drop down checkbox to be AllowCustomText=true ,the empty message is coming and the user can enter everything in that combo box(One work around being disabling all the keypress in javascript code.Which I dont want, and I dont want a custom validator either.

In this forum I have found a way to set the empty text on load ,But that client code is not working,showing the radComboBox is null,when we try to execute the function


 

 





 







3 Answers, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 22 Apr 2010, 02:23 PM
Hello saravanan k,

Here you can find an example project where the "Select All" feature is implemented.

In order to prevent user typing at RadComboBox input I will suggest you handle OnClientLoad event and set the readOnly property like this:

<script type="text/javascript">
    function RadComboBox1_OnClientLoad(sender) {
        sender.get_inputDomElement().readOnly = "readonly";
    }
         
</script>

<telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="select"
    OnItemsRequested="RadComboBox1_OnItemsRequested" AllowCustomText="true"
    EnableLoadOnDemand="true" OnClientLoad="RadComboBox1_OnClientLoad">
</telerik:RadComboBox>


Best wishes,
Kalina
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.
0
Esther Nirmala
Top achievements
Rank 1
answered on 26 Apr 2010, 12:09 PM
Hi,

    I used the same rad combo with check box but both are created dynamically from code behind.. my problem is if i click on the item text it sets the empty message as the selected text.. i dont want to change the selected text but still want have the same "Select one" as empty message.. if i click perfectly on the check box it doesnt change the empty message.. How to solve this..?

Thanks
nimmi
0
Kalina
Telerik team
answered on 29 Apr 2010, 01:36 PM
Hi Esther Nirmala,

Could you please paste your implementation here and describe in more details what behaviour you are trying to achieve?

We need to inspect your code in order to propose a solution to you.
Thank you in advance.

Best wishes,
Kalina
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
saravanan k
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Esther Nirmala
Top achievements
Rank 1
Share this question
or