C1Datagrid rows Export to excel

Posted by: dkrishna on 10 September 2017, 3:45 am EST

    • Post Options:
    • Link

    Posted 10 September 2017, 3:45 am EST

    Hello, Can you please provide sample code Export to excel from C1Datagrid rows in version 4. in excel Datagrid column names should get in Excel . Please provide some sample to save as CSV and .xls .

    Thanks Krishna

  • Posted 10 September 2017, 3:45 am EST

    Hi Krishna,

    Please refer to the following forum posts where the code snippet to export the grid in excel format has been shared: http://our.componentone.com/groups/topic/c1datagrid-for-silverlight-saving-export-to-excel/ http://our.componentone.com/groups/topic/c1datagrid-export-to-excel-issue-with-pagination/

    Thanks, Pragati

  • Posted 10 September 2017, 3:45 am EST

    Iam using C1DataGrid Version 4.0.20111.125 and i didnt find Save property in Datagrid control Can you show alternative solution to this ?

  • Posted 10 September 2017, 3:45 am EST

    Hello,

    Save() method is the extended method. You are suggested to add C1.WPF.DataGrid.Excel.4 dll into the references of your project solution and import the namespace C1.WPF.DataGrid.Excel. Then, only you can find the Save() method of C1DataGrid.

    Hope it helps.

    Regards, Prashant

  • Posted 10 September 2017, 3:45 am EST

    Its a Silverlight application so we are C1Datagrid of Silverlight. Please suggest on it

  • Posted 10 September 2017, 3:45 am EST

    Hello Krishna,

    Sorry for the inconvenience. For Silverlight application you need to add C1.Silverlight.DataGrid.Excel.5 dll into the references of your project solution and import the namespace C1.Silverlight.DataGrid.Excel, then, only you can find the Save() method of C1DataGrid.

    Hope it helps.

    Regards, Prashant

  • Posted 10 September 2017, 3:45 am EST

    we are using Silverlight 4 Version so we upgrade our project as now to SL5. Please suggest solutions in SL4

  • Posted 10 September 2017, 3:45 am EST

    Hello Krishna,

    I wish to tell you that Silverlight4 is a legacy controls and we do not provide any support for Silverlight4 as it is also not suppoerted by Microsoft. There may be a possibility that C1DataGrid for Silverlight4 did not support for exporting to Excel. But, C1DataGrid for Silverlight5 do support your requested scenario. So, you are suggested to please upgrade to Silverlight5. Sorry for the inconvenience caused.

    Regards, Prashant

  • Posted 31 August 2022, 6:51 pm EST

    These links don’t work anymore, could you please provide the solution for Export to excel from C1Datagrid rows in version 4.5?

  • Posted 1 September 2022, 4:12 pm EST

    Hi,

    You need to add C1.WPF.DataGrid.Excel.4.5.2 dll into the references of your project solution and import the namespace C1.WPF.DataGrid.Excel. Then, you can call save method of C1DataGrid to export DataGrid to Excel.(see code snippet)

    
    var dlg = new Microsoft.Win32.SaveFileDialog();
    dlg.DefaultExt = "xlsx";
    dlg.Filter = "Excel Workbook (*.xlsx)|*.xlsx";
    if (dlg.ShowDialog() == true)
    {
        grid.Save(dlg.FileName, FileFormat.Xlsx);
    }            
    
    

    Please refer the attached sampe for the same : DataGridExcelExport.zip

    Best Regards, Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels