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 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.
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 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.
Hello,
After some research, this issue has been determined to be a new feature request. I have sent your feature request directly to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development, you will be notified at that time. Your reference number for this feature request is FR13714.
If you would like to follow up on your feature request at a later point, you may contact Developer Support management via email. Please include the reference number of your feature request in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Meanwhile you could manually iterate trough the UltraGrid cells and with the help of
String.Format method http://msdn.microsoft.com/en-us/library/system.string.format%28v=vs.71%29.aspx
StringBuilder.AppendLine method http://msdn.microsoft.com/en-us/library/ebk18257.aspx
TextWriter http://msdn.microsoft.com/en-us/library/system.io.textwriter.aspx
You could export manually your CSV file.
Please let me know if you have any further questions
There's no built-in functionality in NetAdvantage to export to CSV format. You should Submit a feature request to Infragistics.
You could, of course, loop through the grid rows and create a CSV or text file yourself.