| | Site Map |
Support
Bits
and Pieces
| Load itGrid using a .Net array and ValueMatrix |
This code shows how to populate itGrid with a .Net array using the Valuematrix property, which expects a Variant.
|
private void
buttonTest_Click(object
sender, System.EventArgs e)
object[,] var=new object[10,10];
itGrid1.FixedCols=1;
for
(int
col=0;col<10;col++)
var1[0] = var;
} |
The key to passing a .Net array to ValueMatrix is the use of var1[0] .
If you use:
itGrid1.set_ValueMatrix(1, 1, 10, 10, ref var);
you will get:
Compiler Error CS1502: The best overloaded method match for
'AxitGrid6.AxitGrid.set_ValueMatrix(int, int, int, int, ref object)' has some
invalid arguments, and
Compiler Error CS1503: Argument '5': cannot convert from 'ref object[*,*]' to
'ref object'.