C1Flexgrid is one of the most popular grid controls as of now, in the market. This is so because the control is not only user friendly but has hordes of features that can be quite useful. These features, though in abundance individually, can also be merged together to provide some very cool options. One of these features is that of Export and Export to Excel in particular. When we export the grid to an Excel sheet, there are a number of flags that we can set, and then the better implementation is using these flags in combination with each other. These flags are stored in the FileFlags enum, and are to be set in the SaveExcel method's overload. Now when we use these flags in combinations, there are different precedences that are applied at the time of final exported columns and rows. With the help of this blog, what I want to show is what is the end result, we obtain, when we use different combinations of the export flags. For the sake of simplicity, I have used a simple flex control on the form, bound to the Categories table from the Nwind db. The CategoryName column has been hidden so that we can check all the options available in the FileFlags enum
For more such interesting combinations please refer to the attached sample, select the flag options from first and second dropdowns, if you only want to check a single flag select "None" in the second dropdown, and hit the "Save to Excel" button, the desired excel file should open up for you.
Download Sample