Hi Ranju,
You can a export a Datatable to the excel. Please refer the following code snippet that shows how we can export a Datatable to te Excel.
private void Export_Click(object sender, System.EventArgs e)
{
Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl converter = new
Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl();
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Files(*.xls)|*.xls";
saveFileDialog.DefaultExt = ".xls";
if(saveFileDialog.ShowDialog() == DialogResult.OK)
{
if(radioButton1.Checked)
converter.GroupingGridToExcel(this.gridGroupingControl1, saveFileDialog.FileName,
Syncfusion.GridExcelConverter.ConverterOptions.Visible);
else if(radioButton2.Checked)
converter.GroupingGridToExcel(this.gridGroupingControl1,
saveFileDialog.FileName,
Syncfusion.GridExcelConverter.ConverterOptions.Default);
if(MessageBox.Show("Do you wish to open the xls file now?", "Export to Excel",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Process proc = new Process();
proc.StartInfo.FileName = saveFileDialog.FileName;
proc.Start();
}
}
}
Please refer the following sample in the below link that illustrates the above.
http://websamples.syncfusion.com/samples/Grid.Windows/F73584/main.htmYou can also refer the GridExport sample :
\\Syncfusion\EssentialStudio\5.2.0.25\Windows\Grid.Grouping.Windows\Samples\2.0\Serialization\Excel Export\
Regards,
Asem.