D
David C
I have a GridView that I want to show or hide LinkButtons that exist outside
of the GridView based on a data column in the GridView when that row is
selected. I have the code below for the SelectedIndexChanged event but it
always falls through to the False condition. The data column named
VoidCheck is a SQL Server bit data type. Can someone help me spot the
problem? Thanks in advance.
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
If row.RowState = DataControlRowState.Selected Then
Dim bolvoid As Boolean =
Convert.ToBoolean(DataBinder.Eval(row.DataItem, "VoidCheck"))
If bolvoid = True Then
' voided check selected so show the remove void button
LBtnRemoveVoid.Visible = True
LBtnVoidCheck.Visible = False
Else
LBtnRemoveVoid.Visible = False
LBtnVoidCheck.Visible = True
End If
End If
End Sub
of the GridView based on a data column in the GridView when that row is
selected. I have the code below for the SelectedIndexChanged event but it
always falls through to the False condition. The data column named
VoidCheck is a SQL Server bit data type. Can someone help me spot the
problem? Thanks in advance.
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
If row.RowState = DataControlRowState.Selected Then
Dim bolvoid As Boolean =
Convert.ToBoolean(DataBinder.Eval(row.DataItem, "VoidCheck"))
If bolvoid = True Then
' voided check selected so show the remove void button
LBtnRemoveVoid.Visible = True
LBtnVoidCheck.Visible = False
Else
LBtnRemoveVoid.Visible = False
LBtnVoidCheck.Visible = True
End If
End If
End Sub