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

specify backgroud color for GroupExpression when export to excel

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rizwan Ansari
Top achievements
Rank 1
Rizwan Ansari asked on 08 Jun 2011, 05:23 PM
Hi,

i have radgrid which is bind programmatically and have the groupexpression in radgrid.
i am exporting to excel but i want to highlight the cell of groupexpression with some color when export to excel.
how can i do this.
please help.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Jun 2011, 06:42 AM
Hello Rizwan,

The following code snippet shows how to set BackGround color for Group header when exporting.

C#:
protected void ExportBtn_Click(object sender, EventArgs e)
  {
       foreach (GridGroupHeaderItem groupHeader in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader))
         {
          groupHeader.BackColor = System.Drawing.Color.Blue;
         }
          RadGrid1.ExportSettings.OpenInNewWindow = true;
          RadGrid1.MasterTableView.ExportToExcel();
}

-Shinu.
Tags
Grid
Asked by
Rizwan Ansari
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or