DataList

Tamer_Ahmed

Centurion
Joined
Dec 20, 2003
Messages
159
Location
Egypt
hi all i have a datalist contain a linkbutton let's say called Test
and this button hide the product
but if the product is already hidden in the DB i want the linkbutton to be disabled
 
Not really fully understanding your requirement, it sounds like you are wanting to disable a button (within a button column) within a datalist based upon a field within the database.

If this is the case then try something like after you perform the databind:
Private Sub ConfigureGrid()
Dim i as integer
For i = 0 to dgMyGrid.Items.Count - 1
If dgMyGrid.Items.Item(i).Cells(colSomeField).Text = "disable_my_Button" then
dgMyGrid.Items.Item(i).Cells(colEditButton).Visible = False
Else
dgMyGrid.Items.Item(i).Cells(colEditButton).Visible = True
End If
End Sub
 
Back
Top