I am having a small issue while exporting data from Rad grid view(negative currency value) to Excel.
I am having a column called "Balance" binded a currency value in that column using string Format "StringFormat='$\{0:n0\}'", While i export this data into excel negative values are surrounded with parenthesis like ($321) with Red color but i want a value like $-321 in Excel sheet.
If anyone already faced this one and know the solution please post here.
Thanks in Advance
7 Answers, 1 is accepted
The GridView's export method does not control the way the cells in the exported excel document are formatted. By default they should be exported with "-" and not with "()". How are your values formatted in the GridView's cells? How have you implemented the export?
Regards,Didie
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

I am implemented the Excel report generation as given by the following sample
http://demos.telerik.com/silverlight/#GridView/Exporting
I formatted my balance column using StringFormat='$\{0:n0\}'
<telerik:GridViewDataColumn DataMemberBinding="{Binding Bal,StringFormat='$\{0:n0\}'}" Width="0.78*">
<telerik:GridViewDataColumn.Header>
<TextBlock Text="Balance ($)" />
</telerik:GridViewDataColumn.Header>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Bal,StringFormat='$\{0:n0\}'}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
I am not sure whethere it is a default feature of excel?
Awaiting for your response...
Thanks,
Sudha
I have attached a screenshot showing the result I got and the options the Excel gives me regarding displaying negative numbers. This behavior may occur if you have selected a non-English location as Your Locale (location) or such a Formatting on your Regional Options (Region and Language).
Didie
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Is it possible to show the value as like $-1077 in excel in Export Function itself.
Instead of going and changing the Format Cell setting in excel application?
we have to show the value in $-1077 in our exported file didie.
Awaiting your response.
Thanks,
Sudha
You could subscribe for the ElementExporting event of the RadGridView and change the value to be exported - it is available through the e.Value. You can check this help article as a reference.
Didie
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Hi..
I am using a telerik Radgrid in batch edit mode.I have applied a currency formatting in the GridTemplate column like this:
<ItemTemplate>
<%# Eval("Test", "{0:C0}")%>
</ItemTemplate>
So I am getting negative numbers in brackets as expected. But when I save the number these negative numbers are saved as positive due to the formatting.How can I get rid of this issue? I want it to be saved as negative itself. i.e, I need the brackets also to be reflected in the new value of the radgrid
There is no such column within the Telerik Silverlight RadGridView control. It seems to me that you need information for another technology and product. Please create a thread in the respective forum(I believe your issue is related to the UI for ASP.NET AJAX suite) or raise a ticket for the related technology in order to get more information.
Regards,
Stefan Nenchev
Telerik