Hi, i have this idea on the codes to check whether the userID is match with teh userID in the datagrid. If it is match, the linkbutton in datagrid visibility is true. Else false. But for the following codes, i try doing it when hte userID is match, the button visibility will be false.
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
Dim vUID As String = Session("memberID")
Dim DUID As String = e.Item.Cells(1).Text
Dim l As LinkButton
'the linkbutton is located in the col 6
l = e.Item.Cells(6).Controls(0)
If DUID = vUID Then
l.Visible = False
End If
When i first try it out, it turns out prefectly fine when the visisbility turn false. However, after i try playing around with the codes, it give me an error msg: Specified argument was out of the range of valid values. Parameter name: index in this line : l = e.Item.Cells(6).Controls(0)
Can anyone please help me with it?
Thankx
tiffany
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
Dim vUID As String = Session("memberID")
Dim DUID As String = e.Item.Cells(1).Text
Dim l As LinkButton
'the linkbutton is located in the col 6
l = e.Item.Cells(6).Controls(0)
If DUID = vUID Then
l.Visible = False
End If
When i first try it out, it turns out prefectly fine when the visisbility turn false. However, after i try playing around with the codes, it give me an error msg: Specified argument was out of the range of valid values. Parameter name: index in this line : l = e.Item.Cells(6).Controls(0)
Can anyone please help me with it?
Thankx
tiffany