New to Telerik UI for WPF? Download free 30-day trial

Read Only PropertyDefinition

This article shows how to control which property definitions to be read only.

If you want to control the read-only state of a PropertyDefinition, you can use the IsReadOnly property. You can bind it to a boolean property of your business object. Note that you need to specify the Source of the binding explicitly.

Here is a simple PropertyDefinition declaration:

Example 1: Binding IsReadOnly property

<telerik:PropertyDefinition  
            Binding="{Binding FirstName}"  
            DisplayName="First Name" 
            IsReadOnly="{Binding  Path=IsActive, Source={StaticResource MyViewModel}}"> 
</telerik:PropertyDefinition> 

For an extended example, check out the ReadOnlyPropertyDefinition demo from our SDK Samples Browser.

In this article