Binding DisplayName of RadPropertyGrid

4 posts, 0 answers
  1. Anne
    Anne avatar
    1 posts
    Member since:
    Feb 2012

    Posted 18 Sep 2012 Link to this post

    Hi,

    i would like to bind the display name of a PropertyDefinition in a RadPropertyGrid, but it doesn't work. Is there any way to do this?
    Here my code snippet ...

    Xaml:

         <telerik:RadPropertyGrid Item="{Binding ActualModel}">

              <telerik:RadPropertyGrid.PropertyDefinitions>

                    <telerik:PropertyDefinition

                         Description="{x:Static localProps:Resources.ids_Tooltip_Diameter}"

                         DisplayName="{Binding Path=DiameterLabel}"

                         GroupName="{x:Static cmnProps:Resources.ids_Group_Data}"

                         OrderIndex="1" >

                         <telerik:PropertyDefinition.EditorTemplate>

                              <DataTemplate>

                                   <Border Style="{DynamicResource BorderStyle}" >

                                         <telerik:RadMaskedNumericInput Value="{Binding Path=Diameter}" />

                                   </Border>

                              </DataTemplate>

                         </telerik:PropertyDefinition.EditorTemplate>

                    </telerik:PropertyDefinition>

              </telerik:RadPropertyGrid.PropertyDefinitions>

         </telerik:RadPropertyGrid>

     

     

    Model c#:

              private string _diameterLabel;

              public string DiameterLabel

              {

                    get { return this._diameterLabel; }

                    set

                    {

                         if (this._diameterLabel != value)

                         {

                              this._diameterLabel = value;

                              OnPropertyChanged(() => DiameterLabel);

                         }

                    }

              }

     
    Thanks for help

    best regards Anne


  2. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 21 Sep 2012 Link to this post

    Hi Anne,

     Please find attached sample project according to your requirements. I have property "FirstNameDspl" in my "ViewModel", the thing is that you must bind the DisplayName property to some source e.g. "ViewModel".

    Regards,
    Yoan
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
  4. Andy
    Andy avatar
    10 posts
    Member since:
    Aug 2013

    Posted 29 Aug 2013 Link to this post

    Hi!

    I have an issue in the same area, Culture changed event.
    I am able to bind the DisplayName statically to a Resource file in the following manner:
    xmlns:resx="clr-namespace:wpfapplicationname.Localization"
    DisplayName="{x:Static resx:SettingsModule_Resource.DisplayNameUnit}"
    I was not able to duplicate the binding you gave as an answer to Annie. Tho I think it would have the same problem with changing the culture as the static binding I've given above.
    I want to change culture and I want the DisplayName to change accordingly. Can you help me please?

    /Anders
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Sep 2013 Link to this post

    Hi,

    You can check our documentation here for more information on our localization mechanisms, especially the section about using ResourceManager. This online resource might also be helpful.

    You will need to define resource files for the different languages so that when the language is changed to have the display value updated.
     

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top