protected void btnexport_Click(object sender, EventArgs e) { string selectedimportfilesid = ""; IList<radlistboxitem> collection = ListBoxFileNames.CheckedItems; string selectedfilename = ""; DataTable dtselect = new DataTable(); foreach (RadListBoxItem item in collection) { Label filename = (Label)item.FindControl("lblfilename"); Label Importfileid = (Label)item.FindControl("lblimportfileid"); selectedfilename = filename.Text; selectedimportfilesid = Importfileid.Text; dtselect = selectedexportfilelist(selectedimportfilesid); testgrid.DataSource = dtselect; testgrid.DataBind(); testgrid.ExportSettings.IgnorePaging = true; testgrid.ExportSettings.FileName = selectedfilename testgrid.ExportSettings.OpenInNewWindow = true; testgrid.ExportSettings.Excel.FileExtension = "xls"; testgrid.MasterTableView.ExportToExcel(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)