|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Casting a gridthrough 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 arrGrids.add("grid1") adds a string "grid1".
arrGrids.add(grid1) will add the object grid1. Eliyahu Show quoteHide quote "et" <eagletender2***@yahoo.com> wrote in message news:%23re9sR5BFHA.2984@TK2MSFTNGP11.phx.gbl... > 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 > > > > > Don't know why I didn't catch that one, thanks! Must be a Monday. That did
the trick. Show quoteHide quote "Eliyahu Goldin" <removemeegol***@monarchmed.com> wrote in message news:O6srna5BFHA.4004@tk2msftngp13.phx.gbl... > arrGrids.add("grid1") adds a string "grid1". > > arrGrids.add(grid1) will add the object grid1. > > Eliyahu > > "et" <eagletender2***@yahoo.com> wrote in message > news:%23re9sR5BFHA.2984@TK2MSFTNGP11.phx.gbl... >> 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 >> >> >> >> >> > >
Refresh problem
How to Make Calculator in ASP and Cold fusion Paging for DataList Control auto postback(urgent!) selecting a DataGridRow wipes out the selected row's text Suggestion Can You Change Colors on GridLines? error in getting textbox value in EditCommand Nested datagrids or repeaters...etc. |
|||||||||||||||||||||||