We are binding Generic List of entities (e.g. List<Employee>) with RadGrid (Teleric.Web.UI.dll v2009.2.826.35). We are using GridBoundColumn. Grid gets diplsayed properly. Also it gets exported very well in .pdf and .csv formats. But when we try to export in Excel using ExcelML format, it generates blank excel file. Here is sample code:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void uxRadListView_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
SetGridDataSource();
}
public void SetGridDataSource()
{
uxRadListView.DataSource = GetList();
}
private List<Employee> GetList()
{
List<Employee> employees = new List<Employee>();
for (int i = 0; i < 10; i++)
{
Employee emp = new Employee();
emp.EmpId = 100;
emp.FName = "John";
employees.Add(emp);
}
}
protected void uxBtnExport_Click(object sender, EventArgs e)
{
uxRadListView.ExportSettings.IgnorePaging = true;
uxRadListView.ExportSettings.OpenInNewWindow = true;
uxRadListView.ExportSettings.FileName = "EXCEL";
uxRadListView.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
uxRadListView.ExportSettings.ExportOnlyData = false;
uxRadListView.MasterTableView.ExportToExcel();
}
Does Telerik support Generic Lists to bind grid? If so, then can somebody help to resolve mentioned issue?. Thank you in advance.