Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1493
Mask for numeric editor(%)
posted

Hi ,

        Is there any mask or property by wich I can get values and % sign in my xamdatagrid column containing xamnumericeditor. Please suggest solution thanks.

Parents
  • 2677
    Suggested Answer
    posted

    Hello, 

    If you want to put a % sign, it is just a literal so it will just show up.  All you have to do is modify the mask property for the editor of the column which is by default the XamNumericEditor for a double column.   So, for a column in the grid, you would create an editorstyle for the column and set the mask property like the following code.  <Setter Property="Mask" Value="{}{double:3.0:c}%"/>

    Here is a complete code snippet with the entire column definition.

     

     

     

     

     

     

     

     

     

     

    <

     

     

    igDP:Field Name="Percentage" Label="Percentage">

     

     

     

     

    <igDP:Field.Settings>

     

     

     

     

    <igDP:FieldSettings>

     

     

     

     

    <igDP:FieldSettings.EditorStyle>

     

     

     

     

    <Style TargetType="{x:Type igEditors:XamNumericEditor}">

     

     

     

     

    <Setter Property="Mask" Value="{}{double:3.0:c}%"/>

     

     

     

     

    </Style>

     

     

     

     

    </igDP:FieldSettings.EditorStyle>

     

     

     

     

    </igDP:FieldSettings>

     

     

     

     

    </igDP:Field.Settings>

     

     

     

     

    </igDP:Field>

Reply Children
No Data