Jan H
  • Jan H
  • Newbie Topic Starter
2015-02-07T15:13:42Z
I am looking to use the iGrid ActiveX with dBase (www.dbase.com). So far, everything is working except for one problem I have not been able to solve. All attempts to set a value or property in this format fail:

For lRow = 1 To 10
.AddRow
.CellValue(lRow, 1) = lRow & ", 1"
.CellValue(lRow, 2) = lRow & ", 2"
Next

The problem seems to be that dBase does not resolve the syntax for an object array using CellValue(x,y) = "Text". It interprets this simply as a function.

I've tested the AddCol method, since it returns the object reference for the header. I am able to successfully change any property I need using this syntax:

ObjCol1 = iGrig.AddCol("COL1","Column 1",50)
ObjCol1.eAlignh = 2

What I *think* I need is something that would give me an object reference to the cell, so that I can then get or set the properties the same way I do with the Column. In code, it would look like this (for dBase):

Obj = CellReference( nRow, nCol) ** object reference to the cell object at that row/column
Obj.CellValue = “Value I want to set”

Does such a function exist? If not, are there any other ways for me to address the cell other than Cellvalue(x,y)?

Many thanks in advance for your help!

Jan
Igor/10Tec
2015-02-09T09:18:37Z
When we designed iGrid, we tried to minimize the number of objects one can use to operate on its cells to simplify the object model and to provide the fastest way to access cells and change their properties. That's why you can see a series of CellXXXX properties like CellValue, CellCheckState, CellForeColor, etc. And this is the answer why we are not going to extend the object model of iGrid this way.

However, I have one idea you can try in dBASE. As I can judge from your question, dBASE cannot provide you with a way to use these INDEXED properties in its programming environment, but there should be no problems with calling parameterized iGrid methods. The fact is that every CellXXXX property should have the corresponding method you could try to use from dBASE. If you use the classic OLEView tool to examine the COM iGrid interface (_iGrid), you can find a definition like this:

[id(0x6803009d), propput, helpstring("Returns/sets the value stored in a specified cell."), helpcontext(0x000004a2)]
void CellValue(
                🇮🇳 VARIANT vRow, 
                🇮🇳 VARIANT vCol, 
                🇮🇳 VARIANT rhs);

So in your dBASE code an assignment to the cell value could look like this:

iGrid.CellValue(nRow, nCol, "Value I want to set")

Try that and tell the community whether it works.

***
One note to your post: Fthe AddCol method returns a reference to the column default cell (kinda cell pattern for new cells in this column), but not a reference to the column header object.
Jan H
  • Jan H
  • Newbie Topic Starter
2015-02-09T11:28:41Z
Hello Igor,

thank you for your quick reply. I've tried what you suggested, and it gives me a "bad OLE parameter count" error in dBase.

Jan
Igor/10Tec
2015-02-09T12:02:20Z
Does dBASE have an Object Browser one can use to list all available methods and properties of an ActiveX control?

If so, try to find an equivalent method there. And sure keep us informed.
Jan H
  • Jan H
  • Newbie Topic Starter
2015-02-09T12:40:42Z
Unfortunately, it does not.

Apparently dBase does not support indexed methods - I will check with them about this.

Thank you for your help.

Jan