Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: Autogenerated PropertyGrid : How to change formating of default Editors

$
0
0
Hi,

In The "Plus" edition of the PropertyGrid, you can customize a DoubleUpDownEditor with properties. Something like :
<xctk:PropertyGrid Name="_propertyGrid">
         <xctk:PropertyGrid.EditorDefinitions>
            <xctk:EditorDoubleUpDownDefinition TargetProperties="{x:Type sys:Double}"
                                               CultureInfo="fr-FR" />
         </xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>
and the "." will be replaced by "," for every Double in the PropertyGrid. You can modify the CultureInfo or the FormatString.

In the Community edition, you have to define a new DataTemplate for DoubleUpDowns :
<xctk:PropertyGrid Name="_propertyGrid">
         <xctk:PropertyGrid.EditorDefinitions>
            <xctk:EditorTemplateDefinition TargetProperties="{x:Type sys:Double}">
               <xctk:EditorTemplateDefinition.EditingTemplate>
                  <DataTemplate>
                     <xctk:DoubleUpDown Value="{Binding Value}"
                                        CultureInfo="fr-FR" />
                  </DataTemplate>
               </xctk:EditorTemplateDefinition.EditingTemplate>
            </xctk:EditorTemplateDefinition>
         </xctk:PropertyGrid.EditorDefinitions>
</xctk:PropertyGrid>

Viewing all articles
Browse latest Browse all 2157

Latest Images

Trending Articles



Latest Images

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