<telerik:GridViewDataColumn Header="Happy<LineBreakHere>(Days)"/> |
I want the text to be centered with (Days) appearing underneath "Happy", and I want to do this without implementing any Wrapping/ColumnWidth tricks.
When I try to export the data inside gridview table to an excel file with "xls" file extension a warning message is shown like "different format than specified by the file extension"(Office 2007 is installed in the PC). However, when I change the file extension to xlsx it does not work at all.
Can anyone help me to figure out the problem?
Many thanks
Bo
Bellow is the code
string content = string.Empty;
string extension = "xls";
content = radGridView1.ToHtml(true);
string path = String.Format("Export.{0}", extension);
if (File.Exists(path))
{
File.Delete(path);
}
using (FileStream fs = File.Create(path))
{
Byte[] info = Encoding.Default.GetBytes(content);
fs.Write(info, 0, info.Length);
}
Process.Start(path);