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
585
ComboBox ItemsSource dependent on other property in XamPropertyGrid
posted

Hi,

I have a XamPropertyGrid looking at an object structure similar to the one below. The top level selected object has a list of filters, which each have a table and field. These table and field properties are both comboboxes, and the items source of the Field is the fields property of the selected table object. The only solution I can find to create the ItemsSource binding on the Field combobox is to create a converter which uses reflection to get the internal ParentItem property from the PropertyGridItem and find the table from there. Doing it like this works, but obviously isn't how I'd want to do it and it means that the binding does not receive the property change notification when the table changes, so I have to collapse and expand the filter in the property grid to get the fields list to update.

Is there a better way to do this?

- Name
- Filters
    |- 0
        |- Table
        |- Field
        |- Value
    |- 1
        |- Table
        |- Field
        |- Value

Many thanks,

Richard

Parents
No Data
Reply
  • 1935
    posted

    Hello NeuralDeveloper,

    Thank you for the provided information. I have taken a look at it and the best way for us to assist you is if you provide a small isolated sample with all the necessary models that we can run and use for debugging locally.

    Meanwhile, please do not hesitate to ask if you have any other questions on this matter.

Children