Easier to see in the attached picture than to explain. I have an enum property with corresponding propertydefinition.isreadonly set to true that shows up as expected. I have a string readonly property with corresponding propertydefinition.isreadonly set to true which does not show up as expected. The text box for the value seems to be missing although I can see the property value and it is not editable.
XAML
<telerik:RadPropertyGrid x:Name="SelectionPropertyGrid" x:FieldModifier="private" Grid.Column="1"
AutoGeneratePropertyDefinitions="True"
AutoGenerateBindingPaths="True"
EditorTemplateSelector="{StaticResource PropertyItemTemplateSelector}"
>
</telerik:RadPropertyGrid>
C#
[DataContract]
public abstract class BaseTemplate : INotifyPropertyChanged
{
#region Properties
[DataMember]
public virtual string WorkflowDefinitionDisplayName { get; set; }
[DataMember]
public virtual Enumerations.CLScreenType ScreenType { get; set; }
...
public partial class AuthoringPanel
{
private void OnGeneratingPropertyDefinitions(object sender, AutoGeneratingPropertyDefinitionEventArgs e)
{
var propertyGrid = sender as RadPropertyGrid;
if (propertyGrid == null) return;
if (propertyGrid.Item == null) return;
if (propertyGrid.Item is BaseTemplate)
{
if (e.PropertyDefinition.SourceProperty.Name.Equals("WorkflowDefinitionDisplayName"))
{
if (((BaseTemplate)propertyGrid.Item).ScreenType == Enumerations.CLScreenType.Configuration)
{
e.Cancel = true;
return;
}
e.PropertyDefinition.IsReadOnly = true;
e.PropertyDefinition.DisplayName = "Workflow";
e.PropertyDefinition.Description = "Associated workflow which will be called after completing the Right Click Job screen.";
}