Multiple Select Checkbox with custom Text behavior

9 posts, 0 answers
  1. scottw
    scottw avatar
    21 posts
    Member since:
    Oct 2010

    Posted 11 Apr 2012 Link to this post

    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

  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 16 Apr 2012 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. scottw
    scottw avatar
    21 posts
    Member since:
    Oct 2010

    Posted 16 Apr 2012 Link to this post

    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.
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 19 Apr 2012 Link to this post

    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 >>
  6. scottw
    scottw avatar
    21 posts
    Member since:
    Oct 2010

    Posted 24 Apr 2012 Link to this post

    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!
  7. Ben
    Ben avatar
    6 posts
    Member since:
    Jul 2011

    Posted 24 Jun 2012 Link to this post

    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.
  8. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 27 Jun 2012 Link to this post

    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 >>
  9. moftol
    moftol avatar
    17 posts
    Member since:
    Feb 2008

    Posted 14 Feb 2013 Link to this post

    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.
  10. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 18 Feb 2013 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready