Hi, I'm a first time user in Spreadsheet control. I wanted to do the following task;
1. read an excel file, copy its first sheet,
2. add it to currently active winform spreadsheet
I've done the first with XlsIO control, successfully get the first worksheet, and in my debug console, everything seems fine.
I then do the following (for the reference, I added the code into the form's OnLoad handler)
(let's say, my control is Spreadsheet myControl, my pickedup file was IWorksheet mySheet; )
myControl.Workbook.AddCopy(mySheet);
myControl.Workbook.ActiveSheetIndex = 1;
Then now, on the debug console, everything looks fine. On the other hand, on UI, nothing happend.
Even worse, right clicking on the sheet will trigger null reference.
I then realize I need to invalidate the control to make it redraw. However, all my tries:
myControl.Invalidate();
myControl.ActiveGrid.InvalidateCells();
myControl.ActiveGrid.InvalidateVisuals();
myControl.ActiveGrid.Invalidate();
myControl.Update();
does not seem to make it work either.
My question is, 1. is it possible? 2. is there a better and recommended approach?
Thanks in advance.
Best wishes
Junsoo