controls in the datagrid footer

MikeMc

Newcomer
Joined
Feb 27, 2004
Messages
8
I have a datagrid with approximately 4 template columns. In the 3rd column's footer, I have a text box. Actually I have text boxes in the footer of all the columns, but I'm concerned with the one in the second column.

I am trying to access this controls value, but can't figure out how to get to the control. Where any normal row you could do something like
dg.items(1).cells(2).controls(1)

I can't find anything similar for the footer. Anyone have any idea how I can do this?
 
There's really not much to post, but for example, if the controls were in an actual row, I might do something like:

strVendor = ctype(dg.items(1).cells(0).controls(1),textbox).text.trim
strType = ctype(dg.items(1).cells(1).controls(1),dropdownlist).selectedvalue.tostring
intQty = cint(ctype(dg.items(1).cells(2).controls(1),textbox).text)
...

Instead of accessing the controls that are in the row (item) of the datagrid, I want to access the controls that are in the footer.

I would think there would be something like

intQty = cint(ctype(dg.footer.cells(2).controls(1),textbox).text)

But footer isn't a method of dg, and I can't find anything comparable.
 
Nevermind, I figured it out. For future reference, If you have a 4 column datagrid, no rows, header and footer visible, you can access the header and footer components.

It's not pretty, but, for instance:

dg.controls(0).controls(1).controls(2).controls(1)

will get you to the first control (my case, a textbox) in the third column of the footer.
 
Back
Top