top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to remove decimal using defaultcellvalue in datagrid?

+1 vote
302 views
How to remove decimal using defaultcellvalue in datagrid?
posted Sep 2, 2014 by Khusboo

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

Supoose you want only two digits after decimal then create a datatemplate in Celltemplate of datagrid and set it's string formate property as follows

<TextBox Text="{Binding Property, StringFormat={}{F2},UpdateSourceTrigger=PropertyChanged}">

Suppose you want one digit after decimal then try F1 if zero then F0

Hope this helps.

answer Sep 2, 2014 by Salil Agrawal
Similar Questions
+2 votes

How to remove digits after decimal in vb.net?

if value is 1.9 i want 1
if value is 1.1 i want 1

+2 votes

How to remove decimal from currency datatype?

...