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

Radgrid border problem

2 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
york
Top achievements
Rank 1
york asked on 28 Jun 2011, 11:54 PM
Hi,
When radgrid.gridlines  is set to both, radgrid has double border (see attached image) on firefox, safari and chrome. But if radgrid.gridlines  is set to none, the export excel file does not have border among its cells. How to solve this problem? Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 29 Jun 2011, 11:11 AM
Hello York,

I suppose you want to add border for cells when exporting to excel. Try the following code snippet in GridExporting event to add required styles while exporting. Hope this helps.

C#:
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
{
        if (e.ExportType == ExportType.Excel)
        {
            string css = "<style> body { border:solid 0.1pt #CCCCC; }</style>";
            e.ExportOutput = e.ExportOutput.Replace("</head>", css + "</head>");
        }
}

Thanks,
Princy.
0
york
Top achievements
Rank 1
answered on 02 Jul 2011, 07:55 AM
This question is solved. Please ignore the image attached. Thanks.
Tags
Grid
Asked by
york
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
york
Top achievements
Rank 1
Share this question
or