I have a web form with several grids on it, and a procedure that cycles
through each grid to do a number of tasks, using for next, and am getting a
"Specified cast is not valid" error when I attempted to put the grid names
in an arraylist.
For sample purposes, we'll name the grids grid1, grid2, grid3.
when I manually set each grid, it works fine:
dg = grid1
GetData(dg)
dg = grid2
GetData(dg)
dg=grid3
GetData(dg)
but when I attempted to put the grids in an arraylist, I get the cast error:
arrGrids.add("grid1")
arrGrids.add("grid2")
arrGrids.add("grid3")
for i = 0 to arrGrids.Count-1
dg = ctype(arrGrids(i), DataGrid)
GetData(dg)
next
How else can I do this? tia
Eliyahu Goldin - 31 Jan 2005 13:16 GMT
arrGrids.add("grid1") adds a string "grid1".
arrGrids.add(grid1) will add the object grid1.
Eliyahu
> I have a web form with several grids on it, and a procedure that cycles
> through each grid to do a number of tasks, using for next, and am getting a
[quoted text clipped - 24 lines]
>
> How else can I do this? tia
et - 31 Jan 2005 15:00 GMT
Don't know why I didn't catch that one, thanks! Must be a Monday. That did
the trick.
> arrGrids.add("grid1") adds a string "grid1".
>
[quoted text clipped - 33 lines]
>>
>> How else can I do this? tia