Declined
Last Updated: 30 Jul 2024 08:20 by ADMIN
Denis
Created on: 27 Jun 2024 10:08
Category: UI for WPF
Type: Feature Request
0
Make regular bindings for all properties in PropertyDefinitiion for RadPropertyGrid

Currently PropertyDefinitions have only one Property for DataBinding, which is very strange solution.

All these instances are DependencyObject, but at the same time they are not in the visual tree and we could not bind to a visibility or to readonly or to any other property without some starnge sorkarounds (why this was designed in this way?).

This makes these objects almost useless. becuae we cannot fully use them in an MVVM way (bindings, multiibindings, etc.)

Possible solutions:

  1. provide bindings for all properties to make them be bindable withput any workarounds
  2. Change PropertyDefinitions to something that will live inside visual tree.

 

1 comment
ADMIN
Martin Ivanov
Posted on: 04 Jul 2024 09:16

Hello Denis,

(1) Most public properties of the PropertyDefinition class support data binding. Can you tell me which properties cannot be data bound and you would like to use in such scenario?

(2) Changing the PropertyDefinition object to a visual object will require a change in the public API of the control which will cause a breaking change that may affect some users. Instead, can you check the following suggestions and let me know if they would work for you if implemented in the control?

  • Exposing the internal ParentPropertyGrid property of the PropertyDefinition? This will allow you to make a RelativeSource binding that will look like this and will give you access to the DataContext of the RadPropertyGrid.

    <telerik:PropertyDefinition Visibility="{Binding RelativeSource={RelativeSource Mode=Self}, Path=ParentPropertyGrid.DataContext.MyVisibilityProperty}"
  • Exposing an extra property that gives access to the parent DataContext. The binding syntax will work in a similar way as the code example in the previous bullet.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.