Home Forums WPF controls Xceed DataGrid for WPF Leading zeros on numeric mask

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26433 |

    I’m using a masked text box to display a calculated percentage:

    <DataTemplate x:Key=”percentCellDataTemplate”>
    <xcdg:MaskedTextBox Value=”{xcdg:CellEditorBinding}”
    IncludeLiteralsInValue=”False”
    ValueDataType=”{x:Type s:Decimal}”
    Mask=”### %”
    BorderThickness=”0″/>
    </DataTemplate>

    This column gets populated from a SQL datatable and recalculated on row changes.

    I’m having a problem getting rid of leading zeros. For example the grid will display “005 %” instead of “5 %”.

    Is there any way I can get rid of these leading zeros in my numeric mask?

    Thank you.

    Imported from legacy forums. Posted by Ben (had 2609 views)

    Xceed Support
    Member
    Post count: 5658

    You will need to also change the CellContentTemplate to display the value appropriately.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 254 views)

    User (Old forums)
    Member
    Post count: 23064

    Actually, the DataTemplate in the example above is being used for the CellContentTemplate. Should I be handling this differently?

    Imported from legacy forums. Posted by Ben (had 3453 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.