- Home
- Forum
- Silverlight
- Virtual Grids and vlookup
Virtual Grids and vlookup
I have a sheet in the workbook that contains lists of data used for building combobox lists and for some vlookup functionality. the problem shows up when I don't view this sheet before viewing a sheet that attempts a vlookup against it. This is a very specialized use, so I do know the name of the sheet, and I have attempted to make that sheet the active sheet first in code then change to the sheet I would prefer users see, but that doesn't seem to stick. I would prefer to actually hide this sheet in the workbook, because these lists are it's only use. But unless I actually show the page with the lookup values on the screen, the vlookup will not process correctly.
Any Ideas on how to solve this problem?
thanks,
Melinda Peirce
thanks,
Melinda
Hi Melinda,
Sorry for the inconvenience caused.
Regarding query 1:
GridControl will show the actual value and computed formula values even when the referring sheet is hidden or not viewed yet. It is not the problem in the GridControl. The problem is in the sample source. This can be resolved by changing the following lines of code at ExcelImportDemo sample source.
Index: GridCellImportingBehavior.cs
In Model_QueryCellInfo event:
Code Snipped[C#]
GridSheetFamilyItem family = GridFormulaEngine.GetSheetFamilyItem(gridModel);
string token = family.GridModelToToken[gridModel].ToString();
int index = int.Parse(token.Replace('!', ' '));
We have attached the modified sample for your reference.
Sample:
Regarding query 2:
You can have both virtual and non-virtual grid in a Silverlight application. This can be achieved by using the GridModelImportExtensions.ImportFromExcel() method inside the LoadWorkbook. This method import all value from excel to grid model at the time of importing itself. So there is no need to add behavior to the grid model imported using this method.
We have attached the code snipped for your reference.
Code Snipped [C#]
GridModelImportExtensions.ImportFromExcel(grid.Model, Workbook.Worksheets["Sheet2"]);
Please let us know if this helps.
Regards,
Kathirvel
Import_774629f3.zip
- 2 Replies
- 2 Participants
-
MP Melinda Peirce
- Jul 26, 2012 04:23 PM UTC
- Aug 2, 2012 11:06 AM UTC