CheckBox Template field

reubenfoo

Member
Joined
Nov 25, 2008
Messages
18
Location
Singapore
Programming Experience
Beginner
Hi All,

may i know how do i find the value of the CheckBox template field in a gridview.

The user would select the information they want and those un-checked would be deleted. When the button is pressed, the information on the next page would only show the selected records. Anyone has the VB coding for this? thanks

- the template is called - CheckBox1


attached is the gridview screen shot.
 

Attachments

  • checkbox.jpg
    checkbox.jpg
    114.3 KB · Views: 30
Loop through the rows

VB.NET:
For Each row as GridViewRow In GridView1.Rows

Find the checkbox in the row

VB.NET:
Dim cbx As CheckBox = GridView1.FindControl("CheckBox1")

Check if the CheckBox is checked and then do something with it.

VB.NET:
If cbx.Checked Then...
 
Back
Top