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

group column names in radgrid exporting to excel

1 Answer 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ZR
Top achievements
Rank 1
ZR asked on 29 Oct 2012, 06:02 PM
I'm exporting to excel using biff format and I need to implement the below.
1) How do I group ceratin column names and assign a group name to them. This group header name needs to span the columns grouped and appear at the top. Please see my sample excel sheet attached.

2) how do I specify different colors for different columns in the exported excel sheet while exporting to excel in radgrid. I do not want to use html formatting due to excel warning message.

Please help with code.

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 01 Nov 2012, 12:11 PM
Hello Zaheka,

For setting a different color to the cells you could set Style.BackColor property of the cell. In order to merge the cells you could set the RowSpan/ColSpan property of the choosen cell.
Telerik.Web.UI.ExportInfrastructure.Cell cell1 = e.ExportStructure.Tables[0].Cells["A34"];
cell1.Style.BackColor = Color.Yellow;
cell1.Value = "Adding some text in excel sheet";
cell1.Colspan = 3;


Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
ZR
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or