Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: EditorTemplateDefinition of PropertyGrid for readonly property is not work on v2.2.1 Community Edition. [21089]

$
0
0
Hello.

I found that `PropertyGrid.EditorDefinitions` of some properties was not work on v2.2.1 Community Edition.
Rows for those properties show `toString` text simply.
Those properties don't have setter. (return object, and bind to the object's property in `EditorTemplateDefinition.EditingTemplate` )

I have used `EditorTemplateDefinition` as follow:

```xaml
<xctk:EditorTemplateDefinition>
<xctk:EditorTemplateDefinition.TargetProperties>
<xctk:TargetPropertyType Type="my:CalculatorUpDownViewModel" />
</xctk:EditorTemplateDefinition.TargetProperties>

<xctk:EditorTemplateDefinition.EditingTemplate>
<DataTemplate DataType="xctk:PropertyItem">
<xctk:CalculatorUpDown
Value ="{Binding Value.Value}"
Minimum ="{Binding Value.Minimum}"
Maximum ="{Binding Value.Maximum}"
Increment ="{Binding Value.Increment}"
IsEnabled ="{Binding Value.IsEnabled}"
FormatString="{Binding Value.FormatString}"
/>
</DataTemplate>
</xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:EditorTemplateDefinition>
```

```cs
class MyViewModel {
[DisplayName("DisplayName")]
public CalculatorUpDownViewModel MyProperty
{
get { return this.myProperty; }
// set { }
}
...
}
```

It gets correct working again if I add empty setter into the property.
I think that `EditorTemplateDefinition` should work even if the model's property hasn't have setter.
Actually it had worked until v2.2.0 Community Edition.

Thanks.
Comments: ** Comment from web user: BoucherS **

Hi,

I take note of this. until further investigation, please use an empty setter in your property:
```
set { }
```

Thanks.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>