Ticket Q260318
Visible to All Users

multiselect combo box

created 15 years ago

Hi,
I would like to use a multiselect combo box in a WPF UI. Each item should act like a check box and if an item is selected, the checkmark should be checked/unchecked. The text portion of the combo box should show the selected items as a list separated using a configurable separator.
I was unable to find such functionality directly in ComboBoxEdit-control. I can add check boxes to the items list, but if selected, the check box class name is shown by default in the edit text of the combo box. Also the selected items is not reflected to the text portion of the combo box.
Is the described functionality already implemented in the ComboBoxEdit (or another control) or is the only way to implement it by hand?
Best regards,
Mika

Comments (3)
Stan (DevExpress Support) 15 years ago

    Hi,
    To achieve this goal you should apply CheckedComboBoxStyleSettings to the ComboBox:

    C#
    <dxe:ComboBoxEdit Grid.Column="1" Grid.Row="1" SeparatorString=";"> <dxe:ComboBoxEdit.Items> <dxe:ComboBoxEditItem Content="David Miles" /> <dxe:ComboBoxEditItem Content="John Spor" /> <dxe:ComboBoxEditItem Content="Nick Jackson" /> </dxe:ComboBoxEdit.Items> <dxe:ComboBoxEdit.StyleSettings> <dxe:CheckedComboBoxStyleSettings /> </dxe:ComboBoxEdit.StyleSettings> </dxe:ComboBoxEdit>

    I have attached a sample project, which demonstrates how to implement this feature. Please review it and inform me whether this approach suits your needs.
    Thanks,
    Stan.

      Hi Stan,
      and thanks for the example! It works like a charm. Guess it takes some time before I get used to WPF in order to find right properties from XAML elements.
      Style settings doesn't seem to appear in property editor at all. Is this correct?
      Best regards,
      Mika

      DevExpress Support Team 15 years ago

        Hello Mike,
        Yes, the StyleSettings is hidden. We don't provide the design time for this property.
        Thank you, Marina

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.