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

Can we have a separate Listbox to hold the selected values

5 Answers 133 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Abhishek Dixit
Top achievements
Rank 1
Abhishek Dixit asked on 12 Jun 2009, 01:34 PM
Hello Telerik Team,

 I want to use the RadComboBox as an Auto suggest control. It's working great, the addition I want is that can we have a separate ListBox just below the ComboBox to hold the selected values from the Combobox. So is that possible.
This will help me to help get the multiple parameters on a postback.

Regards,
Abhishek

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 17 Jun 2009, 12:54 PM
Hi Abhishek,

I suggest you subscribe to OnClientSelectedIndexChanged event of RadComboBox and add items to the ListBox in its handler. I've attached a simple page demonstrating this approach. Please download it and give it a try.

Best wishes,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
des white
Top achievements
Rank 1
answered on 04 Jan 2010, 04:57 PM
Happy New Year Telerik,

Its a shame filtering is not availble on the ListBox. That Listbox woiuld be so much better with it.
Ive looked at your code sample and its probably my best solution. Is it possible to populate a radlistbox using the combo box though?
Rather than a standard asp.net list box?

Many Thanks, Des
0
Simon
Telerik team
answered on 05 Jan 2010, 12:50 PM
Hello des white,

Isn't the sample project provided by Yana useful to you in this case?

Can you please describe in more details what you mean by this:
"Is it possible to populate a radlistbox using the combo box though?
Rather than a standard asp.net list box?"

All the best,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
des white
Top achievements
Rank 1
answered on 05 Jan 2010, 01:04 PM
it would be useful if Yana used a RadListBox rather than the standard ListBox provided my microsoft.

Yana uses...

<telerik:RadComboBox> 
</telerik:RadComboBox> 
 
with  
 
<asp:ListBox> 
</asp:ListBox> 

This would have been more useful is the javascript she provided was for use with a
<telerik:RadListBox> 
</telerik:RadListBox> 

 

Regards, Des

0
Genady Sergeev
Telerik team
answered on 07 Jan 2010, 12:35 PM
Hello des white,

You can easily use RadListBox instead of plain ListBox. The principle is exactly the same, hook on the RadComboBox OnClientSelectedIndexChanged event, then grab the selected value, create new RadListBox item and insert it into the RadListBox. You can find detailed information regarding the RadListBox clienthttp://www.telerik.com/help/aspnet-ajax/listbox-client-side-basics.html API here.  Here is basic example code:

selectedIndexChangedHandler(sender, args)
{
    var value = *obtain the selected value*
    var item = new Telerik.Web.UI.RadListBoxItem(value);
    var listBox = $find("RadListBox1");
    listBox.trackChanges();
    listBox.get_items().add(item);
    listBox.commitChanges();
}


Sincerely yours,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Abhishek Dixit
Top achievements
Rank 1
Answers by
Yana
Telerik team
des white
Top achievements
Rank 1
Simon
Telerik team
Genady Sergeev
Telerik team
Share this question
or