Format CSV Export From radGrid

5 posts, 0 answers
  1. Justin
    Justin avatar
    24 posts
    Member since:
    Sep 2011

    Posted 19 Dec 2011 Link to this post

    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!

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 19 Dec 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. felipe
    felipe avatar
    5 posts
    Member since:
    May 2016

    Posted 13 Sep Link to this post

    Hi, my export to csv only shows header, no data.Any help Please!!!
  5. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 14 Sep in reply to felipe Link to this post

    Hello Felipe,

    Please share what you have tried.

    Thanks, Jayesh Goyani

  6. felipe
    felipe avatar
    5 posts
    Member since:
    May 2016

    Posted 14 Sep in reply to Jayesh Goyani Link to this post

    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!!!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017