In the folllowing help article: you indicated that:
Although the HTML Excel format doesn't show any grid lines in the worksheet, you can mimic them by adding the following style to the generated output:
body { border:solid 0.1pt #CCCCCC; }
but you never indicated where this code should be placed?
I was assuming it would be applied to some property related to the export, but could not figure out how to use it.
I ended up doing the following instead:
which works, but the header row has a border on every cell in the entire workbook.
I only want borders on cells related to the output of the grid.
What is the best way to fix this?
Although the HTML Excel format doesn't show any grid lines in the worksheet, you can mimic them by adding the following style to the generated output:
body { border:solid 0.1pt #CCCCCC; }
but you never indicated where this code should be placed?
I was assuming it would be applied to some property related to the export, but could not figure out how to use it.
I ended up doing the following instead:
protected void RadGrid1_ExcelExportCellFormatting(object source, ExcelExportCellFormattingEventArgs e)
{
GridDataItem item = e.Cell.Parent as GridDataItem;
e.Cell.Style["border"] = "solid 0.1pt #000000";
}
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridHeaderItem && bIsExport)
{
GridHeaderItem item = e.Item as GridHeaderItem;
item.Style["border"] = "solid 0.1pt #000000";
}
}
which works, but the header row has a border on every cell in the entire workbook.
I only want borders on cells related to the output of the grid.
What is the best way to fix this?