I thought to use the grid to export dataset to excel from a proccess, and not from a form .
I mean I want to create a windows service, that binds data to a grid and exports it
to excel, without opening a form.
Is this possible?
The following code, created an empty excel file:
grid.DataSource = ds;grid.Show(); grid.Refresh(); string exportFileName = "c:\\X.xls";
ultraGridExcelExporter1.Export(grid, exportFileName);
Hi,
If the grid is not parented to any form, then it will have no BindingContext and it will therefore be unable to get any data.
Try setting grid.BindingContext to a new BindingContext immediately after you call the grid's Constructor.
What you suggest did work better in a console application without opening a form.
But it didnt work in a windows service.
Still excel is empty.