Hi there,
I have a gridview which displays a list of submittted applications with a column that contains an edit link.
<asp:TemplateField HeaderText="Status">
<ItemTemplate>
<asp:LinkButton ID="lnkBtnEdit" runat="server" CommandArgument = '<%# Eval("appID")%>' Text = "Edit" OnClick = "editApp" />
</ItemTemplate>
</asp:TemplateField>
I want to hide the link button if the status (value 1 or 0) of the form is set to 1. Here is the code I am trying to use.
Protected Sub gv1_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'get the cell cell value
Dim status As Integer
If status= 0 Then
'show button
e.Row.FindControl("lnkBtnEdit").Visible = True
Else
'hide button
e.Row.FindControl("lnkBtnEdit").Visible = False
End If
End If
End Sub
I think my mistake lies in getting the status value (as it ouputs 0 for every application). Any pointers would be great. Thanks.