telerik:RadGrid导出Excel隐藏列

//在导出时直接隐藏不需要导出的列
  protected void btnExcel_Click(object sender, EventArgs e)
    {
        rgProduct.Columns[0].Visible = false;
        rgProduct.Columns[1].Visible = false;
        rgProduct.ExportSettings.IgnorePaging = true;
        rgProduct.ExportSettings.ExportOnlyData = true;
        rgProduct.ExportSettings.FileName = "ProductManage";
        rgProduct.MasterTableView.ExportToExcel();
    }

你可能感兴趣的:(C#,.net)