I am trying to format my CSV export from a radGrid. It exports fine but it doesn't seem to pick up any of the styles. This what I am using:
protected
void
imgBtnExportCSV_Click(
object
sender, EventArgs e)
{
foreach
(GridDataItem item
in
grdLeadList.MasterTableView.Items)
//loop through each grid item
{
if
(item.Selected)
{
selectedItems.Add(item.ItemIndex);
}
}
foreach
(GridDataItem item
in
grdLeadList.MasterTableView.Items)
{
// for particuler item
item[
"CompanyName"
].Font.Name =
"Calibri"
;
item[
"CompanyName"
].Style[
"font-size"
] =
"8pt"
;
item[
"CompanyName"
].Style[
"background-color"
] =
"#FFF"
;
item[
"CompanyName"
].Style[
"vertical-align"
] =
"middle"
;
}
grdLeadList.ExportSettings.ExportOnlyData =
true
;
grdLeadList.ExportSettings.OpenInNewWindow =
true
;
grdLeadList.MasterTableView.Columns.FindByUniqueName(
"ClientSelectColumn"
).Visible =
false
;
grdLeadList.MasterTableView.Columns.FindByUniqueName(
"EditCommandColumn1"
).Visible =
false
;
grdLeadList.ExportSettings.FileName =
"ColderLeads"
;
grdLeadList.MasterTableView.ExportToCSV();
}
Is it possible to format CSV export from radGrid?
Thanks!