Datagrid Question

G

Guest

Guys,

Is the itemdatabound event for Datagrid recursive? I have two columns in
grid one with Label and another with linkbutton. I need to set the visibility
of linkbutton to visible or hidden depending on value of label text. Can
someone post some code for VB .net on how to achieve this?

Thanks

Manny
 
G

Guest

Hi Manny,

Suppost the link button in the first column and Label (BoundColumn) in the
second.

If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType
=ListItemType.AlternatingItem Then
Dim lblValue As String = e.Item.Cells(1).Text
Dim link As LinkButton = CType(e.Item.Cells(0).Controls(0), LinkButton)
If lblValue.Equals(some value) Then
link.Visible = True
Else
link.Visible = Flase
End If
}


HTH

Elton Wang
(e-mail address removed)
 

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

Similar Threads

Datagrid Question 2
Datagrid Question 1
Survey details won't go through using php, ajax, Mysql 0
Uhhhhh, What can I do next? 6
Odd Datagrid Behavior 1
Centralizing Code Question 2
Interfering CSS 1
Question 3

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top