C1MultiSelect CombBox dropdown list with Selected items highlighted

Posted by: msloan on 13 June 2018, 10:35 pm EST

    • Post Options:
    • Link

    Posted 13 June 2018, 10:35 pm EST

    Hi,

    I am using a C1MultiSelect CombBox with Selection Mode set to ‘Single’. When I wanted change the selected item by clicking on the arrow, the dropdown list is displayed with previously selected items highlighted.

    How can I stop this from happening?

    Regards,

    Mark Sloan

  • Posted 13 June 2018, 11:31 pm EST

    The AutoSuggestMode of the C1MultiSelect control works more in the way I want for filtering entries in the dropdown list than the AutoComplete feature of the C1ComboBox, which is why I want to use the C1MultiSelect.

  • Posted 14 June 2018, 1:21 am EST

    Is it possible to programmatically add/remove Items from the SelectedItems array, apart from SelectAll or UnselectAll?

    If I use UnselectAll followed by setting SelectedIndex, I find the SelectedValue is correct but the SelectedItems array is empty and nothing is displayed in the Text part of the control.

  • Posted 14 June 2018, 6:24 pm EST

    Hello Mark,

    As per our understanding, you wish that when you click on drop down button, the list should appear but there should be no items selected in it?

    If that is so, then I would like to inform you that it is not possible. The SelectedItem in the list and the display text are linked to each other, so if we remove the selected item from the list then it would also remove the display text of the control. Do let me know, if you are fine with it.

    Also, I could not think of any scenario that needs such requirement. So, request you to please share your use-case, so that we could help you better.

    Re. programmatically adding/removing nodes, you can directly assign the items to the SelectedItemsas follows:```

    _multi.UnSelectAll();

    IEnumerable list=new string { “One”, “Two”, “Three” };

    _multi.SelectedItems = list;

    _multi.IsDroppedDown = true;

    Also, I tried invoking [i]UnSelectAll [/i]method->setting [i]SelectedIndex [/i]property, and doing this, the display text correctly shows the text of the SelectedIndex item.
    
    Attached is a sample application for you refer.
    
    Thanks,
    Ruchir 
    [zip filename="prj_WPFMultiSelect.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-f887fa03-5f24-4922-a29b-527d27e31386.zip[/zip]
  • Posted 20 June 2018, 2:01 am EST

    Hi,

    The code to set the SelectedItems or SelectedIndex works fine if you perform on, say, the click of a button, but you can’t call it from the SelectionChanged Event Handler or even from the event handler for a routed event raised from the SelectionChanged Event Handler.

    One thing I have noticed in your test application is: If you type into the control and press the Enter Key, the SelectionChanged Event Handler is not called until the DropDown button is clicked. Is this correct?

    Regards,

    Mark Sloan

  • Posted 22 June 2018, 1:28 am EST

    Hi Mark,

    1. Setting the selection items in SelectionChanged event would trigger back the SelectionChanged event resulting in loops.
    2. Re. the SelectionChanged event only firing upon clicking dropdown button and not pressing Enter key: We are investigating over it[TFS:328956] and will update you once we receive an update.

    Thanks,

    Ruchir

  • Posted 1 August 2018, 4:43 pm EST

    Hello Mark,

    We are happy to inform you that the issue: ‘selected item by clicking on the arrow not working’ is now fixed. Please upgrade your ComponentOne version to the latest using C1Live installed at ‘C:\Program Files (x86)\ComponentOne\C1Live’

    Also, using the latest version, you do not need to handle PreviewkeyDown event manually.

    Thanks,

    Ruchir

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels