Synchronizing properties

2 posts, 0 answers
  1. guga
    guga avatar
    12 posts
    Member since:
    Mar 2012

    Posted 26 Apr 2012 Link to this post

    Good afternoon. I am having problems with synchronization of properties in a RadPropertyGrid.

    This is my xaml

    <telerik:RadPropertyGrid Name="rpgPropertyEditor" Item="{Binding}" AutoGeneratePropertyDefinitions="False"
                   <telerik:PropertyDefinition DisplayName="Nombre" Binding="{Binding nombre, Mode=TwoWay, ValidatesOnNotifyDataErrors=True}" GroupName="General" Description="Nombre del recurso dentro del item"/>
                   <telerik:PropertyDefinition DisplayName="Cantidad" Binding="{Binding cantidadAsignada, Mode=TwoWay, ValidatesOnNotifyDataErrors=True}" GroupName="Valuación" Description="Cantidad de recursos asignados al item"/>
                   <behaviors:RadPropertyGridIsPropertyEnabledBehavior IsDisabledCollection="{Binding DisableProperties}"/>

    In my ViewModel, I have declared the properties.

    private String _nombre;
    public String nombre
            return _nombre;
            if (_nombre != value)
                _nombre = value;
                SynchronizeChange("nombre", value);
    private double? _cantidadAsignada;
    public double? cantidadAsignada
            return _cantidadAsignada;
            if (_cantidadAsignada != value)
                _cantidadAsignada = value;
                SynchronizeChange("cantidadAsignada", value);

    When loading the ViewModel, runs a method that Sets an object with these properties.

    For example:

    nombre = object.nombre;

    In this way, I can load the property values ​​in my RadPropertyGrid and by a SynchronizeChange, tell my object, that changed them.

    The problem arises when the business logic, modify one of these properties, and to be charged to the View, is not aware of the modification.

    As I can do to learn of changes in my objetct?

    This would be much easier to solve if I could load the properties as "Binding OBJETCT.PROPERTY, Mode = TwoWay". But as far as I have understood, this does not work very well in the RadPropertyGrid.

    Thanks in advance.
  2. Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 27 Apr 2012 Link to this post


    I have tried to reproduce this issue on our side but I did not have any success. I am attaching my test project for your reference. Would you please share with us whether there sre any differences between my approach and yours?

    Kind regards,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top