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

Multiselect DropDownList Retreive selected items

5 Answers 215 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 02 Dec 2010, 09:08 PM
I'm currently using a multiselect enabled dropdownlist.  How do I retreive the list of 'selected' items in the multiselect dropdownlist?

Thanks.

5 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 02 Dec 2010, 10:30 PM

Never Mind.  I figured it out.  If anyone is interested in seeing the solution, please ask in a reply and I'll post the code.

Thx.

0
Peter
Telerik team
answered on 07 Dec 2010, 04:58 PM
Hi Richard,

Thank you for writing.

By default RadDropDownList control does not support multiple selection due to Close operation on mouse click.

We will be glad if you share your solution with community.

Regards,
Peter
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
0
Nathaniel
Top achievements
Rank 1
answered on 27 Jul 2011, 08:23 PM
Richard,

I would like to see your code please.
0
Richard
Top achievements
Rank 1
answered on 27 Jul 2011, 09:11 PM
GetProjectList = "" 
Dim intCount As Integer = 0 
  
For intCount = 0 To (Me.cboPinProject.EditorControl.SelectedRows.Count - 1) 
   GetProjectList = GetProjectList & "'" & Me.cboPinProject.EditorControl.SelectedRows.Item(intCount).Cells(0).Value & "'," 
Next intCount 
  
GetProjectList = Mid(GetProjectList, 1, GetProjectList.Length - 1)

 

 

In the above code, I initialize a string variable 'GetProjectList'.  I also initialize a loop counter 'intCount'
Then I loop through the 'Me.cboPinProject.EditorControl.SelectedRows.Count-1'
In the loop I can reference the 'Me.cboPinProject.EditorControl.SelectedRows.Item(intCount).Cells(0).Value'

Note:  'cboPinProject' is the name of the dropdownlist  and ...Cells(0) is a reference to the first column in the dropdownlist  (my dropdownlist has two columns)

 

0
Jack
Telerik team
answered on 01 Aug 2011, 11:37 AM
Hi Richard,

By looking at your code I can assume that you are using RadMultiColumnComboBox. In fact it also does not support multiple row selection. However, you can work around this limitation by using a RadDropDownButton and hosting RadGridView as a child item. Please consider the following code snippet:
RadGridView grid = newRadGridView();
grid.BindingContext = newSystem.Windows.Forms.BindingContext();
grid.DataSource = table;
grid.Size = newSystem.Drawing.Size(200, 200);
  
RadDropDownButton menu = newRadDropDownButton();
menu.Text = "DropDown";
menu.Items.Add(newRadMenuHostItem(grid));
menu.Location = newPoint(10, 10);
menu.Size = newSize(100, 20);
this.Controls.Add(menu);

If you have further questions, do not hesitate to ask.
 
Best wishes,
Jack
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
DropDownList
Asked by
Richard
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Peter
Telerik team
Nathaniel
Top achievements
Rank 1
Jack
Telerik team
Share this question
or