I have an excel export on my grid in which i export some balances.
Some of the balances are returned in big negative numbers from the database. I need to round them up so they don't show up as big negative numbers in excel.
They show fine in the grid. My column declarations are like:
<telerik:GridBoundColumn Aggregate="Sum" DataField="TransferDollars" HeaderText="Transfers" DataFormatString="{0:c2}" UniqueName="Transfers" SortExpression="TransferDollars" AllowFiltering="false" HeaderStyle-Width="9%" FooterStyle-HorizontalAlign="Right"> </telerik:GridBoundColumn>
I change them to a currency format in my InfrastructureReporting event, how can i round them up before export.
protected virtual void grid_InfrastructureExporting(object sender, GridInfrastructureExportingEventArgs e) { foreach (xls.Row row in e.ExportStructure.Tables[0].Rows) { row.Cells[2, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[3, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[4, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[5, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[6, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[7, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[8, row.Index].Format = "$#,##0.00;($#,##0.00)"; row.Cells[9, row.Index].Format = "$#,##0.00;($#,##0.00)"; } }How can I do this?