Hide and set default values, confused?

6 posts, 0 answers
  1. Martin
    Martin avatar
    39 posts
    Member since:
    Sep 2008

    Posted 25 Mar 2013 Link to this post

    I would like to hide default values for CLR types without making them nullable.

    I have properties like Top, Left and the default value for int is 0, but I don't want to show zero, just values set by the user or by me in code.
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 28 Mar 2013 Link to this post

    Hi,

    Based on the previous communications with you , I guess that you are using the PropertySets feature. May, I ask you whether am I right? Basically, RadPropertyGrid relies exclusively on bindings and they will automatically retrieve a property's value, which is the default one if it is not initialized with a new value, so such a customization won't be easy to implement. May, I ask you for some more extensive information on your scenario, so that we could think in its context.

    All the best,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Martin
    Martin avatar
    39 posts
    Member since:
    Sep 2008

    Posted 28 Mar 2013 Link to this post

    I just think that default values are the same a not providing any values.

    It's would just be nice to have a flag "HideDefaultClrValues" on the property grid.
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 28 Mar 2013 Link to this post

    Hello,

     Unfortunately, supporting such a feature natively won't be compatible with our current architecture. However, I have thought of an easy modification. You can subscribe to RadPropertyGrid's FieldLoaded event and rebind the respective editors by setting OneWayToSource binding mode. Can you please confirm, whether this approach works for you?

    Regards,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Martin
    Martin avatar
    39 posts
    Member since:
    Sep 2008

    Posted 28 Mar 2013 Link to this post

    Will it still be possible to update the field? if so I will give it a try
  7. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 28 Mar 2013 Link to this post

    Hello,

     Well, OneWayToSource binding will propagate changes only from the View (UI) to the ViewModel and not the other way around. I guess that this is what you really need to achieve your requirements?

    Greetings,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready