
Raja Rajeswari Mohan Venkataraman
Top achievements
Rank 1
Raja Rajeswari Mohan Venkataraman
asked on 27 Feb 2012, 06:55 PM
Hi,
I have a radgrid in which I'm binding the data. For instance I have the column "SER" in the grid. The value of "SER" in the grid is
"NG 101101". The length is fixed i.e 10.
When i export the above data using export to excel, the radgrid exports the above data to "NG 101101". It removes one space. I don't want the excel to remove the space. I need to maintain the data as such.
Could you please help me achieve what I want.
Thanks,
Raji
5 Answers, 1 is accepted
0

Richard
Top achievements
Rank 1
answered on 29 Feb 2012, 08:13 PM
Raja:
It looks like you've already posted this question in a previous forum thread that was answered by Telerik support:
radgrid export to excel bot accepting double white space
"I suppose that you are using the HTML format. In this case, Excel will display the whitespaces in the exported file in the way they are presented in RadGrid. Under normal circumstances, two or more whitespaces will be merged into one, single character. You could work around this if you disable the HtmlEncoding property for the given column and then use & nbsp ; as empty characters."
Did you try this solution? Do you need help with this?
Regards,
It looks like you've already posted this question in a previous forum thread that was answered by Telerik support:
radgrid export to excel bot accepting double white space
"I suppose that you are using the HTML format. In this case, Excel will display the whitespaces in the exported file in the way they are presented in RadGrid. Under normal circumstances, two or more whitespaces will be merged into one, single character. You could work around this if you disable the HtmlEncoding property for the given column and then use & nbsp ; as empty characters."
Did you try this solution? Do you need help with this?
Regards,
0

Raja Rajeswari Mohan Venkataraman
Top achievements
Rank 1
answered on 06 Mar 2012, 04:53 AM
Yes,
I need help in how to disable the HtmlEncoding property for the given column and then use & nbsp ; as empty characters."
Could you please help me?
Thanks,
Raji
I need help in how to disable the HtmlEncoding property for the given column and then use & nbsp ; as empty characters."
Could you please help me?
Thanks,
Raji
0
Sample code:
Regards,
Daniel
the Telerik team
protected
void
RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
if
(e.Column.UniqueName ==
"MyColumn"
)
(e.Column as GridBoundColumn).HtmlEncode =
false
;
}
Regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0

Raja Rajeswari Mohan Venkataraman
Top achievements
Rank 1
answered on 23 Mar 2012, 06:49 PM
Hi Daniel,
I have a dataset which has a column SER and the value of SER is "NG 101101" ie. there is double space in the value. While binding the
dataset to the radgrid, the grid displays as "NG 101101" ie. only single is shown in the grid. While expoerting to excel it exports only single
space. Is there any way in the radgrid to display the value with double spaces.
Thanks,
Raji
I have a dataset which has a column SER and the value of SER is "NG 101101" ie. there is double space in the value. While binding the
dataset to the radgrid, the grid displays as "NG 101101" ie. only single is shown in the grid. While expoerting to excel it exports only single
space. Is there any way in the radgrid to display the value with double spaces.
Thanks,
Raji
0
Hello Raji,
You can handle the ItemDataBound event and replace the empty spaces with . Note that the HtmlEncode of the corresponding column should not be enabled.
Hope this helps.
Regards,
Daniel
the Telerik team
You can handle the ItemDataBound event and replace the empty spaces with . Note that the HtmlEncode of the corresponding column should not be enabled.
Hope this helps.
Regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.