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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top