Exporting from RadGrid to Excel - multiple cell problem RRS feed

  • Question

  • User-1324178819 posted

    I have a situation where my RadGrid has some rows Containing multiple rows


     When I export this using RadGrid's export functionality, I see multiple cells used for 1 cell 

    Thursday, December 27, 2012 9:58 AM

All replies

  • User-1716253493 posted
    what i know rg has export feature, you dont need export manualy like gv. You can export rg to many format. See documentasion. demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultcs.aspx
    Thursday, December 27, 2012 10:22 AM
  • User-1324178819 posted

     <ExportSettings IgnorePaging="True" HideStructureColumns="true" ExportOnlyData="True">


    I use these values with RadGrid and when I export to Excel, it generates a separate cell for each row (which I cant leave like that)

    Thursday, December 27, 2012 10:36 AM
  • User3866881 posted


    Considering it that this belongs to a 3-rd party control tool of Telerik, I'm afraid Microsoft cannot do much comments on that.


    If you'd like to use GridView instead (because that's Microsoft control). I'd like to recommand you this:


    Thursday, December 27, 2012 8:29 PM
  • User-1324178819 posted

    I use standart GridView to export to excel but the same thing happens.

    HTML code is separated into multiple cells :(

    protected void ExceleAktarLinkButton_Click(object sender, EventArgs e)
           Response.AddHeader("content-disposition", "attachment;filename=testExport.xls");
           Response.Charset = "";
           Response.ContentType = "application/vnd.xls";
           System.IO.StringWriter stringWrite = new System.IO.StringWriter();
           HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
       //HTML Codes into Visual HTML
       protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
           if (e.Row.RowType == DataControlRowType.DataRow)
               for (int j = 0; j < e.Row.Cells.Count; j++)
                   string encoded = e.Row.Cells[j].Text;
                   e.Row.Cells[j].Text = Context.Server.HtmlDecode(encoded);

    Screenshot(below) when exported from standart GridView.

    1 cell in my GridView is separated into multiple rows :(

    Friday, December 28, 2012 3:24 AM
  • User3866881 posted


    To be very honest, it's not an easy task to export a GridView with Html formation.

    Maybe you can try to use this tool:


    Friday, December 28, 2012 3:41 AM