bertino12
asked on
Select a row for highlighting - Gridview control with checkbox
I have a checkbox column in my gridview control. I want to make it so on checkchanged it selects the row or deselects the row so the row is highlighted. Here is the code I have so far. I just need to select the row now.
Protected Sub CheckBox1_CheckedChanged(B yVal sender As Object, ByVal e As EventArgs)
Dim CB As CheckBox
CB = CType(sender, CheckBox)
If CB.Checked = True Then
'select the row so its highlighted
ElseIf CB.Checked = False Then
'unselect the row so its no longer highlighted
End If
End Sub
Protected Sub CheckBox1_CheckedChanged(B
Dim CB As CheckBox
CB = CType(sender, CheckBox)
If CB.Checked = True Then
'select the row so its highlighted
ElseIf CB.Checked = False Then
'unselect the row so its no longer highlighted
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim CB As CheckBox
CB = CType(sender, CheckBox)
If CB.Checked = True Then
//I'm doing a cast on CheckBox parent to GridViewRow and then setting its color, do this in VB
((GridViewRow)CB.parent).B
ElseIf CB.Checked = False Then
//I'm doing a cast on CheckBox parent to GridViewRow and then setting its color, do this in VB
((GridViewRow)CB.parent).B
End If
End Sub
Regards, Rodrigo Leote