protected
void BtnExportar_Click(object sender, EventArgs e)
{
List<Festivo> listaFestivos = ....
//se crea un RadGrid vinculado a la lista de festivos.
RadGrid rg = new RadGrid();
//configuramos el radGrid para que tenga una sola columna
GridBoundColumn columnaFestivos = new GridBoundColumn();
columnaFestivos.UniqueName =
"Festivos";
columnaFestivos.DataField =
"Fecha";
columnaFestivos.HeaderText =
"Festivos";
rg.MasterTableView.Columns.Add(columnaFestivos);
rg.DataSource = listaFestivos;
rg.DataBind();
this.Exportar(rg);
}
private void ConfigureExport(RadGrid rg)
{
rg.ExportSettings.ExportOnlyData =
true;
rg.ExportSettings.HideStructureColumns =
true;
rg.ExportSettings.IgnorePaging =
true;
rg.ExportSettings.OpenInNewWindow =
true;
rg.Columns[0].Visible =
false;
}
public void Exportar(RadGrid rg)
{
ConfigureExport(rg);
rg.MasterTableView.ExportToExcel();
}
can you help me? thanks