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

    Hello,<br><br>I have a cell range that is bound to a Spread data Binding Adapter whose datasource is a certain datatable.<br><br>I format those cell range using the follwing :<br><br>// Cell formatting to be applied to each of the cell ranges<br>// Currency Symbol, DecimalSeperator, Decimal Places.<br>// This must be read from the Regional Settings in windows<br>FarPoint.Win.Spread.CellType.CurrencyCellType currcell = new FarPoint.Win.Spread.CellType.CurrencyCellType();<br><br>currcell.CurrencySymbol = "£";<br>currcell.DecimalSeparator = ".";<br>currcell.DecimalPlaces = 2;<br><br>// Apply the cell formatting attributes to the cell range<br>fpSpread1.ActiveSheet.Cells[iStartRow, iStartColumn, iEndRow, iEndColumn].CellType = currcell;<br><br>The currency format is displayed as intended.<br><br>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.<br><br>All help will be highly appreciated and many thanks in advance.<br><br>Regards<br>DairyMilk7777<br><br><br><br>
  • Replied 8 September 2017, 1:15 pm EST

    <P>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.</P>
Need extra support?

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

Learn More

Forum Channels