This is a migrated thread and some comments may be shown as answers.

Binding DisplayName of RadPropertyGrid

3 Answers 177 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Anne
Top achievements
Rank 1
Anne asked on 18 Sep 2012, 02:26 PM

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


3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 21 Sep 2012, 08:12 AM
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.

0
Andy
Top achievements
Rank 1
answered on 29 Aug 2013, 11:01 AM
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
0
Dimitrina
Telerik team
answered on 03 Sep 2013, 02:33 PM
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 >>
Tags
DataFilter
Asked by
Anne
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Andy
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or