Current filter:
                                You should refresh the page.
                                  • Hi Team,

                                    Here my requirement is to export data in the grid control to Excel sheet.

                                    GridView.ExportToXls() is working fine, but that is exporting only the data in the UI or only visible columns.

                                    Could you please suggest me an option to export all the columns associated to the grid control i.e., all the hidden as well as visible columns.

                                    Its really urgent for me... Thanks In Advance.

                                2 Solutions

                                Creation Date Importance Sort by

                                Brendon is right, the GridControl's content is printed/exported using the WYSIWYG principle.
                                As for implementation of the mentioned requirements, you can use the GridView's "Saving and Restoring layout" functionality.
                                Look at the following code snippet:

                                gridView1.SaveLayoutToXml("tempLayout.xml"); foreach (GridColumn column in gridView1.Columns) { column.Visible = true; } gridView1.ExportToXls("export.xls"); gridView1.RestoreLayoutFromXml("tempLayout.xml");

                                I hope you find this information helpful.

                                • Shanmugam Krishnappa 09.27.2012

                                  Hi DevExpress team,
                                  Thank you very much for the responses. The solution from Brendon was very much helpful. It served the purpose.
                                  Thank you very much once again

                                The GridControl uses a WYSIWYG export routine. In order to export/print all of the grid's columns, you will have to set them all to Visible before exporting. My suggestion is to loop through all of the grid's columns, set them to visible, exporting/print the GridControl, and then hide the columns again.