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

Radgrid Export csv Contains '&nbsp'

3 Answers 243 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sandy
Top achievements
Rank 1
Sandy asked on 20 Aug 2012, 06:47 AM

Hi,

the tittle name is that radgrid export csv contains   the character of &nbsp cannot be shown on title. 

I have a radgrid in which I'm binding the data. 
After I export data using export to CSV, In the CSV file,I find blank cells are replaced by  I don't want that.
Could you please help me achieve what I want.

Thanks,

Sandy

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Aug 2012, 01:06 PM
Hello Sandy,

I need to reproduce this problem locally. Please post your code here and I will try to run it on my end.

Thanks,
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
Sandy
Top achievements
Rank 1
answered on 24 Aug 2012, 07:12 AM
I have received the email.

my code is below:
////////////////////////////////////////////////////////////////////////////////

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Telerik.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;


namespace Practice
{
    public partial class radgrid : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
        private void binddata()
        {    
            DataTable dt = new DataTable();
            DataRow dr;
            DataColumn dc;


            dc = new DataColumn();
            dc.ColumnName = "A";
            dc.ReadOnly = true;
            dc.Unique = true;
            dt.Columns.Add(dc);


            dc = new DataColumn();
            dc.ColumnName = "B";
            dc.ReadOnly = true;
            dc.Unique = true;
            dt.Columns.Add(dc);
 
            dr= dt.NewRow();
            dr[0] = "1";
            dr[1] = "1";
            dt.Rows.Add(dr);


            dr = dt.NewRow();
            dr[0] = "0";
            dr[1] = "";
            dt.Rows.Add(dr);


            myGrid.DataSource =dt;
        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            myGrid.MasterTableView.ExportToCSV();
        }


        protected void myGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            binddata();
        }
    }
}


Thanks a lot.
0
Daniel
Telerik team
answered on 29 Aug 2012, 09:04 AM
Hello Sandy,

Thank you for sharing your code. I created a runnable demo based on your snippets. I'm afraid however, that I'm still unable to recreate your scenario. Please download the attached website (it is fully runnable, just add the assemblies in the bin folder) and let me know if I'm leaving something out.

Kind 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.
Tags
Grid
Asked by
Sandy
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sandy
Top achievements
Rank 1
Share this question
or