Hi,
Hi Daniel,
Aspose.Cells.Workbook book = new Workbook(“C:/temp/book1.xlsx”);
book.Worksheets[0].Cells[1000, 1600].PutValue("");
book.Save(stream, SaveFormat.Xlsx);
stream.Position = 0;
this.gridDesktop1.ImportExcelFile(stream);
Hi Babar,
Hi,
Hi,
Hi again,
danielastertech:
Loading the file with Aspose Cells Workbook and saving in a temp file bypasses the problem of dealing with the worksheets of the grid itself. If I could do it without an intermediary temp file, it will be a relief.
danielastertech:
Hi,However, the code I post in this comment works only if you change the maxcolsize to 255 !This is a value loved by developers ! When it is 256, the grid displays only the cells loaded in the original file and ignores the runtime PutValue().
{
book.Save(stream, SaveFormat.Xlsx);
stream.Position = 0;
gridDesktop1.ImportExcelFile(stream);
}
Hi Babar,
Hi Daniel,
Hi again,
Hi Daniel,
{
this.gridDesktop1.Worksheets[0].ColumnsCount = 1000;
this.gridDesktop1.Worksheets[0].RowsCount = 1000;
this.gridDesktop1.RefreshControl();
this.gridDesktop1.Refresh();
}
Hi Babar,
danielastertech:
Fantastic. It works.So I understand I should not access the gridDesktop.Worksheets object before the event FinishLoadFile is fired. If I access it immediately after the importExcelFile() which in my case is called by my MFC MDI OnOpenDocument() event method, I get the workbook of a new document.
danielastertech:
By the way, if it interests someone, I have developed a bridge dll who is called by a Native C++ MFC MDI unmanaged application (with the document/view MS architecture) which calls a .NET User Control C# dll with Aspose gridDesktop.I have been told a few times it was not feasible and I have it.