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

selecting multiple item in radcombobox without checkbox option

6 Answers 132 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Subramanian
Top achievements
Rank 1
Subramanian asked on 25 Nov 2010, 04:17 AM
Hello experts..

I have a scenario in my application where end users can send mail to multiple users with seperator ' ; ', they can select from combo items(contact name) or they can enter a new contact's email id. when they enter mail id which is not in the combo list item, i shoud popup the add contact modal popup and once they add it, i will bind the added user and they can select it from combo. so when user sends the mail, i need to get selected contact's contact id and send the mail to those id's

I was able to achieve the above functionality with few issues,
they are
1. when user type a text 'Ra' and combo lists the 'Raja', if user uses keyboard and presses END button and ' ; ', my code assumes it as some text entered other than item frm combo, if user presses 'Ra' and user selects the Raja using mouse and presses ';' means my code works fine.
2. when users enters mail id alone and not entering ';' means, i cant prompt user to add contact.
3. Im storing the contact id in hidden field and when i click send button I'm retrieving it.

I used radcombo, binding its data from web method as follows

 

 

<telerik:RadComboBox ID="rdCombotxtToUser" runat="server" Width="397px" Height="140px" Enabled="false"

 

 

 

EmptyMessage="Please enter your contacts (e.g John Doe;Jane Doe)" AllowCustomText="true" AutoCompleteSeparator=";" EnableAutomaticLoadOnDemand="true" EnableItemCaching="true" MarkFirstMatch="true" OnClientKeyPressing="OnClientKeyPressing">

 

 

 

<WebServiceSettings Method="GetContactName" Path="~/WebServices.asmx" />

 

 

 

</telerik:RadComboBox>

When users enters ; im firing following below javascript

 

 

 


function
OnClientKeyPressing(sender, e)

 

{

 

 

 

var strSelecteditem

 

 

 

if (e._domEvent.keyCode == "186")

 

{

 

 

var combo = $find("<%= rdCombotxtToUser.ClientID %>");

 

strSelecteditem = combo._selectedItem;

 

 

if (strSelecteditem == null) {

 

 

 

var mdlPopup = $find("mdladdContactPopupBId");

 

document.getElementById(

 

"<%=txtName.ClientID %>").value = combo._filterText;

 

mdlPopup.show();

}

}

Can anyone suggest me any other method or solution to prompt user only when mail id or items not in combo is entered.

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 25 Nov 2010, 07:40 AM
Hello Subramanian,


Give a try with following approach:

1) You can check for whether an item is already there in RadComboBox when typing in input box (when pressing Enter). If not found cancel the click event.
Use the findItemByText() method by passing the entered text, if it returns null, means no item with such text.


2) If item is not there with entered text and if it is in e-mail format, then prompt user to add new contact (Use the step.1 technique to check whether item there).

3) Access the corresponding item (using findItemByText method) and get the value of the item to use it.


Hope this suggestion helps.


-Shinu.
0
Cori
Top achievements
Rank 2
answered on 26 Nov 2010, 06:27 PM
Hello Subramanian,

This demo should be of use:

http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx

It uses the separator to split muliple selections.

I hope that helps.
0
Sabaratnam
Top achievements
Rank 1
answered on 17 May 2016, 09:09 PM

Hello,

How do I enable "Ctl+Click" selection of multiple RadComboBox items without the "CheckBox".

Is multiple selection possible without the "CheckBoxes"?

0
Ivan Danchev
Telerik team
answered on 18 May 2016, 05:31 AM
Hello,

Multiple selection in the ComboBox is possible only with CheckBoxes enabled.

Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
pankaj
Top achievements
Rank 1
answered on 28 Sep 2016, 01:42 PM

Hi Ivan, 

Why we can't use "ctrl+click" for selecting mutiple values from RadCombobox without "checkbox"? Can we not achieve this with jquery or some other scripting language?

 

Thanks, 

Pankaj Joshi

 

0
Ivan Danchev
Telerik team
answered on 03 Oct 2016, 08:05 AM
Hello Pankaj,

Multiple selection without enabling the CheckBoxes functionality is not supported. By design with CheckBoxes disabled only a single item can be selected and this behavior cannot be changed with jQuery.

Regards,
Ivan Danchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Subramanian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Cori
Top achievements
Rank 2
Sabaratnam
Top achievements
Rank 1
Ivan Danchev
Telerik team
pankaj
Top achievements
Rank 1
Share this question
or