Accessing a control on a datagrid in VB.NET

G

Geoff Davis

I'm sure this is easy to do but I seem to be having a problem making this
work. Basically I have an image button in column 4 of a datagrid and I want
to dynamically change it's text. The problem is I am not sure where to do
this and how to do it.

Anybody out there who could point me in the right direction?

G.
 
J

J P Deka

Davis ,


Try this
Dim griditem As DataGridItem

Dim myCheckbox As CheckBox

For Each griditem In dbgrid.Items

myCheckbox = CType(griditem.Cells(4).Controls(0), CheckBox)

next



// here instead of check box you can use any other control.
 
J

J P Deka

Davis ,


Try this
Dim griditem As DataGridItem

Dim myCheckbox As CheckBox

For Each griditem In dbgrid.Items

myCheckbox = CType(griditem.Cells(4).Controls(0), CheckBox)

next



// here instead of check box you can use any other control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top