Currency Format on cell range bound to databinding adapter lost after Update method is called on the tables DataAdapter.

Posted by: dairymilk7777 on 8 September 2017, 1:15 pm EST

  • Posted 8 September 2017, 1:15 pm EST


    I have a cell range that is bound to a Spread data Binding Adapter whose datasource is a certain datatable.

    I format those cell range using the follwing :

    // Cell formatting to be applied to each of the cell ranges
    // Currency Symbol, DecimalSeperator, Decimal Places.
    // This must be read from the Regional Settings in windows
    FarPoint.Win.Spread.CellType.CurrencyCellType currcell = new FarPoint.Win.Spread.CellType.CurrencyCellType();

    currcell.CurrencySymbol = "£";
    currcell.DecimalSeparator = ".";
    currcell.DecimalPlaces = 2;

    // Apply the cell formatting attributes to the cell range
    fpSpread1.ActiveSheet.Cells[iStartRow, iStartColumn, iEndRow, iEndColumn].CellType = currcell;

    The currency format is displayed as intended.

    However when I call the Update method on the DataAdapter to update the DataTable associated with the cell range, the cell range seems to looses all the cell formatting attributes.

    All help will be highly appreciated and many thanks in advance.


  • Replied 8 September 2017, 1:15 pm EST


    You would either need to reset the CellType after each refresh of  the bound DataSource or you can set the DataAutoCellTypes property of the Spread to False.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels