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

Format CSV Export From radGrid

4 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 19 Dec 2011, 04:16 PM
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!

4 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 19 Dec 2011, 06:01 PM
Hello Justin,

Sorry but this thing is not possible with CSV export because CSV format is based on a plain text so...

Note : it only applies in excel export and pdf export.

Thanks,
Jayesh Goyani
0
Danniel
Top achievements
Rank 1
answered on 13 Sep 2016, 07:20 PM
Hi, my export to csv only shows header, no data.Any help Please!!!
0
Jayesh Goyani
Top achievements
Rank 2
answered on 14 Sep 2016, 08:56 AM

Hello Felipe,

Please share what you have tried.

Thanks, Jayesh Goyani

0
Danniel
Top achievements
Rank 1
answered on 14 Sep 2016, 04:15 PM
Hi Jayesh, I solved the problem. the issue was when I set into ExportSetting the openinnewwindow = true the excel was blocked by IE.and the csv doesnt worked by de exportonlydata = true, y set to false and worked fine!!!
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Danniel
Top achievements
Rank 1
Share this question
or