Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
818
xamGrid and xamComboEditor
posted

We have a need to allow users to select multiple values from a dropdown list in the grid. We have successfully created a custom column using Devin's blog post as a reference and we can get the values from the Editor control into the underlying object, but we cannot figure out what to do about the binding property in ResolveEditorControl. For single selection scenarios, we use:

            m_Editor.SetBinding(XamComboEditor.SelectedItemProperty, editorBinding)

But that won't work for multi-select. We tried leaving the binding off, but the selected values are only displayed for the first item in the grid (although they appear to be persisted to the underlying data object). Any guidance would be greatly appreciated.

Parents
  • 40030
    Offline posted

    Hi, 

    So there isn't a really good way to do this. 

    First, SelectedItems isn't a DepenencyProperty, so you can't bind to it. 

    Even if it was, your underlying property would have to be a Settable Collection of a matching type ObservableCollection<object> in order for it to even be settable. 

    If you really needed to do it...your best it is to just rig up some events in your ColumnContent provider, and manually populate the comobBox, when it goes into edit mode. And then when the selection chagnes in the comboBox, manually update your underlying item. 

    -SteveZ

     

Reply Children