Hello friends,
I'm trying to Import excel sheet from Ultrawingrid. I do know that there is a excelexporter.export to export the Ultrawingrid to Excel but Don't know how to import. Please help me out.
Thanks,
AB
Hi AB,
There's no simple one-step way to import data from Excel into a WinGrid. There are too many factors to account for, like the number of weeksheets and the relationships between the data.
The Infragistics Excel engine has the ability to load an Excel file into memory. So you could load the Excel data into memory and then use that data to build a DataSource for the grid, such as an UltraDataSource or a DataTable.
Hi Mike,
It would be really helpful if you could share an example code of that.
AB.
Hello Mike,
Your code helped me out. Thank you.
Hi,
There was no attachment on your post, so I just copied and pasted the data into a new Excel sheet. This data is very simple, so it will be very easy to load this data into a grid, assuming you can make assumptions about the data and in particular the data types. I have attached a small sample project here that loads it into the grid. You will need to change the code to point to the correct file location.
The attachment contains the sample excel data.
That's tough to do without knowing what the data in the Excel sheet(s) looks like. In a very simple case where you have one Worksheet and the data is flat (no hierarchical data), it's pretty simple, but there are still complicated like how you would determine the data type(s) of the columns.You would probably have to be aware of the structure in the Excel sheet(s) ahead of time and make assumptions based on a defined structure.
Do you have a sample Excel sheet you are working with? If you want to attach one here, I could probably whip up a quick sample for you. :)