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
535
Show 4 digits but allow more than that while editing
posted

I am using Xamdatagrid which is bound to some data. Currently the grid shows around 8 digits after decimal, What I want is that when I click the cell for edit mode it should show only 4 digits after decimal but it should not limit me when I try and enter digits.

For example: If the value is 14.52648 it should display 14.5264 but when I click and start editing it should allow me so while editing the cell will look like 14.526489561

I am using 15.1.20151.2008

Parents
No Data
Reply
  • 6365
    Offline posted

    Hello Neelesh,
     
    In order to display only 4 digits after the decimal point, an approach I can suggest you is to create a Style that is targeting the XamNumericEditor in the Resources of the XamDataGrid. Afterwards by setting the Format property of the editor to "###.0000" and reference it from the respective Field, you should be able to achieve the desired effect.
     
    <igDP:XamDataGrid.Resources>
        <Style x:Key="numericStyle" TargetType="{x:Type igEditors:XamNumericEditor}">
                        <Setter Property="Mask" Value="{}{double:4.8:c}" />
                        <Setter Property="Format" Value="###.0000" />
        </Style>
    </igDP:XamDataGrid.Resources>

    <igDP:NumericField Name="Price" EditorStyle="{StaticResource numericStyle }">

    Since the Mask property works directly with the Value of the editor, the PromptChars and the trailing zeros will be visible while the editor is in edit mode.

    If you require any further assistance on this matter, please do not hesitate to ask.

Children