How to export ultragrid to csv file. I know how to export to word, pdf, and excel. Can you show me example of exporting grid to csv file.
Hi,
I just wanted to know if you were able to solve your issue based on our suggestions or you still need help?
Just let me know.
Thank you.
hi, I wanted to check if this feature has been implemented in any recent version of your ultra product.
Recently we had to export into csv from the ultragrid that had 3000 columns with 1200 rows, and our app was going out of memory. I investigated and the ultimate culprit was "gridrow.Cells[z].Value.ToString()".
When I found out that this was the sole statement responsible for memory leaks, i just took a reference to the DataTable from the grid's DataSource property, and used that for export, and tested with 3000 columns with 10000 rows, no mem leaks.
I can't see any way that referencing the Value of a cell could cause a memory leak. It will cause an increase in memory usage, since you are forcing the row and the cell object to be created. But that's not a leak, it's just normal memory usage caused by the creation of object. Those object will get garbage collected when they are no longer referenced, so that's not a leak.
You could save a lot of memory by not creating the cell. You can do that by use the GetCellValue method on the cell, instead of accessing the cell via the indexer.
gridrow.GetCellValue(z).ToString()
You might also want to take a look at the WinGrid Performance Guide.
To answer your question... no, there's still no built-in export to CSV. The grid has some infrastructure for exporting to Excel, though. And in theory, you could write your own code to take advantage of that exporting logic. It's probably not worth it if you already have working code in place, though.