Home Forums WinForms controls Xceed Grid for WinForms Formatting for numbers

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

    Does anyone have any code samples to use to help formatting of numbers?

    I would like to be able to insert commas into large number cells.

    I would rather display 1,333,444,555 instead of 1333444555.

    Thanks.

    Imported from legacy forums. Posted by Rick (had 4036 views)

    User (Old forums)
    Member
    Post count: 23064

    Use a format provider like so

    Column c = grid.Columns[“Blah”]

    System.Globalization.NumberFormatInfo numformat = new System.Globalization.NumberFormatInfo();

    numformat.CurrencySymbol = String.Empty;
    numformat.CurrencyPositivePattern = 0;
    numformat.CurrencyNegativePattern = 1;

    c.FormatProvider = numformat;
    c.FormatSpecifier = “c”;

    Peter Henry
    IT Revolution

    Imported from legacy forums. Posted by Peter (had 335 views)

    User (Old forums)
    Member
    Post count: 23064

    Use a format provider like so

    Column c = grid.Columns[“Blah”]

    System.Globalization.NumberFormatInfo numformat = new System.Globalization.NumberFormatInfo();

    numformat.CurrencySymbol = String.Empty;
    numformat.CurrencyPositivePattern = 0;
    numformat.CurrencyNegativePattern = 1;

    c.FormatProvider = numformat;
    c.FormatSpecifier = “c”;

    Peter Henry
    IT Revolution

    Imported from legacy forums. Posted by Peter (had 328 views)

    User (Old forums)
    Member
    Post count: 23064

    Use a format provider like so

    Column c = grid.Columns[“Blah”]

    System.Globalization.NumberFormatInfo numformat = new System.Globalization.NumberFormatInfo();

    numformat.CurrencySymbol = String.Empty;
    numformat.CurrencyPositivePattern = 0;
    numformat.CurrencyNegativePattern = 1;

    c.FormatProvider = numformat;
    c.FormatSpecifier = “c”;

    Peter Henry
    IT Revolution

    Imported from legacy forums. Posted by Peter (had 386 views)

    User (Old forums)
    Member
    Post count: 23064

    when I tried this code I got an error message Xcced.Wf.DataGrid.Column does not contain a definition for ‘FormatProvider’??????????

    Imported from legacy forums. Posted by dalia (had 303 views)

    Xceed Support
    Member
    Post count: 5658

    This is code for the Grid for .NET. The error you got refers to the WPF DataGrid, a different product.

    Imported from legacy forums. Posted by CharlesB (had 4959 views)

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