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

[Solved] Add $ sign in Export to EXcel column

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Siva
Top achievements
Rank 1
Siva asked on 03 Apr 2013, 06:50 AM
Hi
     I want to Add "$" sign in the Exported Excel column .In the Grid am using  gridtemplate column 

Aspx
--------

<

 

telerik:GridTemplateColumn

HeaderText=" Value (USD)" UniqueName=" Value (USD)">

 

<ItemTemplate>

 

<asp:Label ID="lblDollar" Text="$" runat="server"></asp:Label>

 

<asp:Label ID="lblValue"  Text='<%# Eval("Value")%>' runat="server"></asp:Label>

 

</ItemTemplate>

 

</telerik:GridTemplateColumn>
On exporting the radGrid I only got the values in the Excel column not the $ sign. wat i am missing. Thanx in advance..

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 Apr 2013, 07:14 AM
Hi,

Try the following code.
C#:
protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
    if ((e.FormattedColumn.UniqueName) == "UniqueName")
    {
        e.Cell.Style["mso-number-format"] =@"$0.00";
    }
}

Thanks,
Shinu
Tags
Grid
Asked by
Siva
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or