format grid cell data to currency

9 posts, 0 answers
  1. mjaisi p
    mjaisi p avatar
    11 posts
    Member since:
    Aug 2009

    Posted 28 Aug 2009 Link to this post

    how to format the input number to currency format in a cell in telereik grid
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 31 Aug 2009 Link to this post

    Hi mjaisi p,

    You can use DataFormatString column property (UnitPrice column in this demo) or IValueConverter for the column binding.

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. mjaisi p
    mjaisi p avatar
    11 posts
    Member since:
    Aug 2009

    Posted 31 Aug 2009 Link to this post

    Hi

    could you please send code for it.

    Thanx
    mjaisi
  4. mjaisi p
    mjaisi p avatar
    11 posts
    Member since:
    Aug 2009

    Posted 31 Aug 2009 Link to this post

    Hi

    I saw the code, however i dont find the property "ResultFormatString" in my xaml for

    My code:

    <

     

    gridView:GridViewDataColumn Width="180" UniqueName="Amount" Header="Compensation Change" DataFormatString = "{}{0:0.0}" />

     



    thanx
    mjaisi
  5. mjaisi p
    mjaisi p avatar
    11 posts
    Member since:
    Aug 2009

    Posted 31 Aug 2009 Link to this post

    Hi

    I currently use this version - 2009.2.701.1020

    Am i using the right version.

    Thanx
    mjaisi
  6. mjaisi p
    mjaisi p avatar
    11 posts
    Member since:
    Aug 2009

    Posted 01 Sep 2009 Link to this post

    hi

    see my below code. still i am unable to convert a number entered (120 to 120.00).

    After completing the edit, when i move from one cell to another, i dont find the number is formatted from 120 to 120.00.

    <

     

    gridView:GridViewDataColumn Width="180" UniqueName="Amount" Header="Compensation Change" DataFormatString="{}{0:c}" >

     


    Thanx
    mjaisi
  7. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 03 Sep 2009 Link to this post

    Hi mjaisi p,

    I have prepared a sample project to test for possible faults. Everything seems ok to me .
    Please have a look at the sample attached.
    It uses your format string , and the resulting display is number formatted as currency.

    In case you still get the wrong formatting , please try with the "{}{0:0.00}" format string.
    Since the "{}{0:c}"  syntax is dependant on the system currency format settings it will get different output on different machines depending on the local settings.


    Sincerely yours,
    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Jack Helm
    Jack Helm avatar
    18 posts
    Member since:
    Jan 2010

    Posted 06 May 2010 Link to this post

    I have searched these forums and also looked in the help file that comes with the contorls and have yet to find anyplace that explains adequately how to use the DataFormatString setting. Have you, anywhere that I may have missed, listed the various formats or how to create custom formats for this XAML setting? Or does it use the same conventions that Microsoft string formatting uses? Some detailed examples of this would be helpful. Thanks.
  9. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 10 May 2010 Link to this post

    Hello Jack Helm,

    The DataFormatString is the same format string that is used by Microsoft. Could you please take a look at this help page that list several numeric format strings.

    Regards,
    Milan
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top