ich gridview am Export in Excel und das ist mein Code-wie formatierte Excel-Spalten machen Autofit mit C#
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", fileName));
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.Write("<meta http-equiv=Content-Type content=\"text/html; charset=windows-1250\">\n");
HttpContext.Current.Response.Write("<html xmlns:o='urn:schemas-microsoft-com:office:office'\n" +
"xmlns:x='urn:schemas-microsoft-com:office:excel'\n" +
"xmlns='http://www.w3.org/TR/REC-html40'>\n" +
"<head>\n");
Hier bin ich nicht in der Lage Spalten automatisch anpassen zu lassen. Ich bin verwirrt und suchte auf Google und versuchte mit vielen Lösungen, aber das Problem bleibt. Jede Hilfe wird geschätzt. Danke