Pre-Checking checkboxes?

  • Thread starter Thread starter Roy
  • Start date Start date
R

Roy

Hey all,
I have a "worker" page where users can click on checkboxes, fill in
notes, etc. I wish to "pre-check" the checkboxes if certain criteria are
met. I assume it must be done in the For loop shown below. The event in
this case is what event code is show in "event" field below.


Sub Binddata()
Dim myconn As New
SqlConnection("server=localhost;uid=name;pwd=password;database=test")
Dim tmpUID As Label
tmpUID = CType(Page.FindControl("uid"), Label)
myconn.Open()
Dim mycom As New SqlCommand("SELECT dates,note,event FROM L2_Test WHERE
cast(uid as nvarchar(40)) ='" & tmpUID.Text & "'", myconn)
Dim newadp As New SqlDataAdapter(mycom)
Dim newds As New DataSet
newadp.Fill(newds, "one")
notesgrid.DataSource = newds.Tables("one").DefaultView
myconn.Close()
notesgrid.DataBind()

Dim row As DataRow
For Each row In newds.Tables("one").Rows


Next
End Sub
 
Handle PreRender event for notesgrid. In the event go through every row,
check the criteria and set checkbox Checked property.

Eliyahu
 

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

Back
Top