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
85
Custom ComboEditor
posted

Hi,

Currently I've been using XamComboEditor and XamMultiColumnComboEditor successfully, and they have both worked just great.

I'd like to create a new control that is also a combo, but this time to allow you to select from a hierarchical tree view.

How should I do that? Is it possible to inherit from Infragistics.Controls.Editors.ComboEditorBase with my own control?

Would you be able to provide a sample for that?

Thanks!

Parents
No Data
Reply
  • 34510
    Offline posted

    Hi Rennen,

    We don't currently have a sample that implements a tree control in the combo dropdown but I think it should be possible.  You can see how we define the Popup used in the dropdown in the DefaultStyles folder: C:\Program Files (x86)\Infragistics\2015.2\WPF\DefaultStyles\XamComboEditor\generic.xaml

    The Popup contains an ItemsPanel which is used to render the items in the ItemsSource but I imagine that you could replace this panel with a TreeView control and just bind it to the XamComboEditor's ItemsSource.  This should get you a populated tree but you will have to handle selection yourself.  The XamComboEditor has a SelectedItem property which you might be able to directly bind to the TreeView's own SelectedItem so that might actually be all you need.  It really depends on what your requirements are.

    The beauty of XAML, though, is that you can replace a lot of things as long as you know what the original XAML looks like and we provide all of that with our product.  In some cases if we name a component with "PART_" then it's likely we try and access that in internally so removing it would be bad.  I'm pretty sure removing the ItemsPanel from the XamComboEditor dropdown would be bad so you'll have to hide it instead.

    Let me know if you run into an questions/issues while trying to implement this and I'll try to help.

Children