This is a migrated thread and some comments may be shown as answers.

Radgrid Export with currency style

4 Answers 182 Views
Grid
This is a migrated thread and some comments may be shown as answers.
zorro
Top achievements
Rank 1
zorro asked on 15 Jun 2012, 02:25 AM

Hi team,

I'm using radgrid to export to excel file. Everything is ok except one thing. I would like to format the value as currency style but when exporting done the style is Accounting

I catch the event

grid_ExcelExportCellFormatting(object source
                               , ExcelExportCellFormattingEventArgs e)

and I handled in this as below

e.Cell.Style["mso-number-format"] = "Currency";

Please help!
Kim.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Jun 2012, 05:18 AM
Hello Zorro,

Try setting the currency format as shown below.
C#:
void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
  if (e.FormattedColumn.UniqueName == "UniqueName")
  {
    e.Cell.Style["mso-number-format"] = "Currency"
  }
}

Thanks,
Princy.
0
zorro
Top achievements
Rank 1
answered on 15 Jun 2012, 06:16 AM
Hi Princy,

Thanks for your way. I followed exactly but it's still "Accounting" style instead "Currency".
Is there another way?

Thanks
0
Princy
Top achievements
Rank 2
answered on 18 Jun 2012, 07:59 AM
Hello,

I cannot reproduce the issue at my end. Please make sure that you are using ExportCellFormatting for changing the format and not the ExcelExportCellFormatting event which is marked as obsolete as from RadControls for ASP.NET AJAX Q1 2011.

Thanks,
Princy.
0
zorro
Top achievements
Rank 1
answered on 01 Jul 2012, 04:46 AM
Thanks for your reply. I solved this issue. Please prefer if you interest by these link

http://stackoverflow.com/questions/11029409/radgrid-export-with-currency-value

http://kimcuhoang.blogspot.com/2012/06/radgrid-export-to-excel-with-custom.html (this is my personal blog)
Tags
Grid
Asked by
zorro
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
zorro
Top achievements
Rank 1
Share this question
or