hi,
I try to load nearly a million records to my data structure and page those records using ultrawinGrid only 1000 at a time. This helps me avoid System.OutOfMemory exceptions which could cause otherwise trying to load them directly to an ultrawingrid.
But I have a functionality to export this grid (the entire pages and not 1000 pages alone) to excel. In order to achieve this, I programatically create an ultraWinGrid, and use an ultraDatasource to point to my already loaded data structure. Although I set up my ultraGrid.Datasource property to this ultraDatasource, I am not able to export it using ultraGridExcelExporter. Should I call InitializeRow on all the rows in the programatically created ultrawinGrid?
Thanks for the help in advance.
Shankar
Hi Shankar,
shankarchandru said:Although I set up my ultraGrid.Datasource property to this ultraDatasource, I am not able to export it using ultraGridExcelExporter.
Why not? What's the problem?
If you are creating a WinGrid in code and it's never parented to a form, then my guess is that it's not working because the grid has no BindingContext and so it has no data. Try setting the grid's BindingContext to the same BindingContext as the "real" grid that you are displaying, or to the BindinginContext of the form.
Thanks for the quick update. That was the problem indeed. I am able to export the grid properly from a load on Demand WinGrid.
As I said earlier, I am trying to export a lot of rows. So I had to export the grid to multiple tabs in Excel due to row limitation of Excel. Also, I read another reply from you on a separate forum thread.
http://news.infragistics.com/forums/p/36060/210139.aspx#210139
This article was helpful to export to multiple worksheets in Excel, but I am running into a problem where the FileLimit behavior doesn't stop when we reach 65536 rows in Excel. It seems to stop randomly beyond this. This is a problem since, I have to ensure I add the header row of the grid in each of the worksheets before I start exporting rest of the rows.
Every datagrid row I am exporting into excel strictly uses only 1 row in Excel as well. So I am not sure why this would go wrong.
Thanks for all your help in this matter.