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

Multiple Select Checkbox with custom Text behavior

8 Answers 300 Views
CheckedDropDownList
This is a migrated thread and some comments may be shown as answers.
scottw
Top achievements
Rank 1
scottw asked on 11 Apr 2012, 05:58 PM
I am having difficulty finding the right circumstances to create the following:

I need a drop down list with check boxes for each item.
Each item in the drop down displays a human readable string, but has a char value
Each time an item is checked, the Text value must be a concatenation of each selected char value
Each time the Text is edited, each individual letter in the Text field must check the DropDown item with the matching char value.

_________
- 1 - First Item
- 2 - Second Item

1________
x 1 - First Item
- 2 -Second Item

2________
- 1 - First Item
x 2 - Second Item

12_______
x 1 - First Item
x 2 - Second Item


In each of the above crude examples, the value of each item in the list would be 1 and 2.

I tried implementing the example code you provide in your RadControls Demo application, following the DropDown & List/Creating New Items example, and I am therefore able to get multiple checkboxes to display. (It appears your source code in the RadControls Demo is missing the "this.radDropDownList1.CreatingVisualListItem += this.CreatingVisualListItem;" for the list and dropdownlist objects.) 

However, I need a few more things I have not been able to find in the forum notes:

1) I need to keep the drop down from closing when checkboxes are selected.
2) I need to set the Text object of the list to a custom value (concatenation of the values of the checked items).
3) I need the reverse, setting the checkboxes based on what is typed in the field
4) I need to insert an OK button in the drop down to allow the user to close it when they are done checking boxes.

Any thoughts?


Thanks

8 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Apr 2012, 11:04 AM
Hi Scott,

Thank you for contacting Telerik support.

Please, refer to this KB Article, which describes how you can implement RadMultiSelectDropDownList.
I have prepared a small sample based on the article, which demonstrates how to create scenario similar to yours - please, refer to the attached sample project.

Could you share more details about the issue with our example, because I was not able to identify it.

Kind regards,
Peter
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
scottw
Top achievements
Rank 1
answered on 16 Apr 2012, 10:24 PM
Thank you.

It looks like the attached project in your post and the project in the article you reference are slightly different, and solve different aspects of what I need. I have cobbled together a hybrid of the two, and the results look promising. Let me play and get back to you with a final conclusion or with further questions.
0
Peter
Telerik team
answered on 19 Apr 2012, 02:56 PM
Hello,

I am happy that you managed to build the project with desired requirement.

Do not hesitate to write back in case you need further assistance.

Greetings,
Peter
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
scottw
Top achievements
Rank 1
answered on 24 Apr 2012, 04:38 PM
Final conclusion, things working apparently very well. Had only to add a couple of event handlers to decouple the relationship between the drop down and the text box.

Thanks for your help!
0
Ben
Top achievements
Rank 2
answered on 25 Jun 2012, 03:04 AM
Hi Scottw/Peter,

Could you please share the code in which you combine together both project as my requirements are matching with Scottw's requirement.
0
Peter
Telerik team
answered on 27 Jun 2012, 07:31 AM
Hello Ben,

Thank you for writing.

You can find the source code of the checked drop-down list implementation below in this thread and in this knowledge base article, but we cannot provide the source code of Scottw, because it is not our property.

Greetings,
Peter
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
moftol
Top achievements
Rank 1
answered on 14 Feb 2013, 06:08 AM
Hi, 

i downloaded the given demo but it is not working properly, i.e i am not able select multiple items, if i select one item and try to select to another item the already selected item gets deselected, please provide any guidance.

Thanks.
0
Peter
Telerik team
answered on 18 Feb 2013, 02:50 PM
Hi farooq,

We will address this behavior in our Q1 2013 build. For the time being, you can handle the PopupClosing event and cancel the event if the arrow button is not pressed:

this.radDropDownList1.PopupClosing += new RadPopupClosingEventHandler(radDropDownList1_PopupClosing);
 
 void radDropDownList1_PopupClosing(object sender, RadPopupClosingEventArgs args)
 {
     args.Cancel = !this.radDropDownList1.DropDownListElement.ArrowButton.IsPressed;
 }

I hope this helps.

Greetings,
Peter
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
CheckedDropDownList
Asked by
scottw
Top achievements
Rank 1
Answers by
Peter
Telerik team
scottw
Top achievements
Rank 1
Ben
Top achievements
Rank 2
moftol
Top achievements
Rank 1
Share this question
or