E
et
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
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