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

BIFF and dynamic columns

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 07 Feb 2013, 07:05 PM
When exporting my grid to HTML everything works fine. I recently changed the formatting to BIFF and am seeing a problem with the header text on the dynamically added gridbound columns. For some reason, on these columns only, the header text is being repeated (ex Long NameLong Name). I also have dynamic template columns in my grid and they export just fine in BIFF.

As I said, this all works just fine with the HTML format.

Has anyone else seen this problem?
Thanks in advance for your help. 

Code to add new column
bfield = new Telerik.Web.UI.GridBoundColumn();
bfield.AllowFiltering = true;
bfield.AllowSorting = true;
bfield.SortExpression = colName.AttributeName;
bfield.ShowSortIcon = true;
radGrid.MasterTableView.Columns.Add(bfield);
bfield.DataField = colName.AttributeName;
bfield.HeaderText = colName.DisplayName;
bfield.UniqueName = colName.DisplayName.Replace(" ", string.Empty);
bfield.HeaderStyle.Font.Size = 10;


Code to export
radGrid.ExportSettings.OpenInNewWindow = true;
radGrid.ExportSettings.ExportOnlyData = false;
radGrid.ExportSettings.IgnorePaging = true;
radGrid.ExportSettings.Excel.Format = GridExcelExportFormat.Biff;
radGrid.MasterTableView.ExportToExcel();

1 Answer, 1 is accepted

Sort by
0
Robin
Top achievements
Rank 1
answered on 07 Feb 2013, 08:20 PM
I was able to figure this out. I'm not sure why, but it's related to AllowSorting = true;
I changed the code so that AllowSorting is false if I am exporting and the double text in the header is not appearing.
It has to be related to something else I'm doing in the code because I have a small sample project where it's not happening at all.

Thanks, anyway.
Tags
Grid
Asked by
Robin
Top achievements
Rank 1
Answers by
Robin
Top achievements
Rank 1
Share this question
or