GridView SelectedIndexChanged

D

David C

I have the following code to show or hide some LinkButtons on my aspx page
and it does not appear to be working. The column named "VoidCheck" is a
bit/boolean column on the SQL database that is used to populate the
GridView.
When I select a row I want to show or hide the LinkButtons. Can anyone spot
what might be wrong with this, or have another event to accomplish this?
Thanks.

David

Protected Sub gvVendorChecks_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
gvVendorChecks.SelectedIndexChanged
' Get the currently selected row using the SelectedRow property.
Dim row As GridViewRow = gvVendorChecks.SelectedRow

Dim isvoid As Boolean =
Convert.ToBoolean(DataBinder.Eval(row.DataItem, "VoidCheck"))
If isvoid = True Then
' voided check selected so show the remove void button
LBtnRemoveVoid.CssClass = "Show"
LBtnVoidCheck.CssClass = "Hide"
Else
LBtnRemoveVoid.CssClass = "Hide"
LBtnVoidCheck.CssClass = "Show"
End If
End Sub
 

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,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top