FormatString doesn't work

2 posts, 0 answers
  1. Ales
    Ales avatar
    5 posts
    Member since:
    Dec 2011

    Posted 14 Mar 2012 Link to this post

    Hi All,

    a have this procedure :

    foreach (GridViewDataColumn dataColumn in radGridBatches.Columns)
     {               
          dataColumn.TextAlignment = ContentAlignment.BottomRight;
          dataColumn.FormatString = "{0:F2}";
    }





    but the number in Grid are 600
                                               592.35
                                              600
                                               etc...
    need somebody help ?

    lot thanks Alda

    PROBLEM SOLVED, DOUBLE CONVERTED TO DECIMAL
  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 16 Mar 2012 Link to this post

    Hello Alda,

    Thank you for writing.

    In order to make this format string to work, you have to apply it to a GridViewDecimalColumn. If you are setting it to a GridViewTextBoxColumn, it will not work. If this is not your case, I would kindly ask you to provide some more details on your case and grid setup. 

    I am looking forward to you reply.

    Kind regards,
    Ivan Petrov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top