• Connexion
  • Microsoft.com
  • France (Français)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)Italia (Italiano)United States (English)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
Le réseau pour les développeurs
 
 
Accueil
 
 
Library
 
 
Formation
 
 
Téléchargements
 
 
Support technique
 
 
Communautés
 
 
Forums
 
 
 
Le réseau pour les développeurs > Forums - Accueil > Windows Presentation Foundation (WPF) > Multiselect ComboBox Implementation Ideas
Poser une questionPoser une question
Rechercher dans les forums :
  • Rechercher dans le forum Windows Presentation Foundation (WPF) Rechercher dans le forum Windows Presentation Foundation (WPF)
  • Rechercher dans tous les forums MSDN Rechercher dans tous les forums MSDN
 

TraitéeMultiselect ComboBox Implementation Ideas

  • vendredi 8 septembre 2006 03:49Kevin CheukMSFTMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Utile
    0

    I need to create a ComboBox which allows for multiselection (the selections will be display in a comma delimited string of the TextBlock portion of the control).  Ideally, the dropdown of the ComboBox will be filled with items with a CheckBox, with the item being checked if it's been selected.  What would be the best way to approach such a control?  Should I modify the templates of either the ListBox control or the ComboBox control or create a new user control (maybe based off one these controls)?

    Thanks,

    Kevin

    • RéponseRéponse
    • CitationCitation
     

Réponses

  • mardi 26 septembre 2006 15:45d00d Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    Utile
    1
    OK this may sound a little off but here it goes... Have a combobox containing a listbox which has checkboxes as its items... Will this help? I mean the combobox wont close when you are selecting items from the list; I haven't tried this though.
    • RéponseRéponse
    • CitationCitation
     

Toutes les réponses

  • vendredi 8 septembre 2006 07:47d00d Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Réponse proposée
    Utile
    1
    An ideal solution would be to have the combo box contain CheckBoxes as its contents, this way you can allow multiple selections from the same ComboBox.
    • Proposé comme réponseRSud jeudi 16 octobre 2008 23:35
    •  
    • RéponseRéponse
    • CitationCitation
     
  • samedi 9 septembre 2006 22:29Kevin CheukMSFTMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Utile
    0

    Thanks for the reply d00d.  I created a ComboBox control and changed its item template to datatemplate with a checkbox control in it.  The only problem with the control is once you select an item from the dropdownlist of the ComboBox, it disappears.  How can keep this from occuring?  I want the dropdownlist to stay open for multiselection and for the dropdownlist to only close when the control loses focus (sort of like the MenuItem Control when you enable its StaysOpenOnClick property). 

    I've tried enabling the StaysOpenOnEdit property on the ComboBox and handling the PreviewMouseDown on  the ComboBox and ComboBoxItem, but to no success for either.  Anymore suggestions would appreciated. 

    • RéponseRéponse
    • CitationCitation
     
  • vendredi 17 octobre 2008 19:39zepher684 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Réponse proposée
    Utile
    0
    jiggs said:

    Thanks for the reply d00d.  I created a ComboBox control and changed its item template to datatemplate with a checkbox control in it.  The only problem with the control is once you select an item from the dropdownlist of the ComboBox, it disappears.  How can keep this from occuring?  I want the dropdownlist to stay open for multiselection and for the dropdownlist to only close when the control loses focus (sort of like the MenuItem Control when you enable its StaysOpenOnClick property). 

    I've tried enabling the StaysOpenOnEdit property on the ComboBox and handling the PreviewMouseDown on  the ComboBox and ComboBoxItem, but to no success for either.  Anymore suggestions would appreciated. 



     Hey,
    Isn't it that if we click on the checkbox instead of the entire row the combobox dosen't collapse for each selection. This way byu clicking on the chekcbox we can do multiple select.
    Zepher684
    • Proposé comme réponsezepher684 vendredi 17 octobre 2008 19:39
    •  
    • RéponseRéponse
    • CitationCitation
     
Besoin d'aide sur les forums ? (Forum aux questions)
 
© 2009 Microsoft Corporation. Tous droits réservés.
Gérer votre profil
|
Contactez-nous
|
Newsletter MSDN
|
Conditions d'utilisation
|
Marques
|
Confidentialité