Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First I bind the rptDepts repeater at itemediting</p> <pre><code>Public Sub lvProjects_OnItemEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewEditEventArgs) Dim rptDepts As Repeater = lvProjects.EditItem.FindControl("rptDepts") rptDepts.DataSource = bllDept.getServices() rptDepts.DataBind() 'get tasks for projectID Dim hdnprojectID As HiddenField = lvProjects.EditItem.FindControl("hdnStudyID") getTasks(hdnProjectID.Value, rptDepts) End Sub </code></pre> <p>Then when rptDepts is databound, I bind the rptTasks repeater</p> <pre><code>Protected Sub lvDepts_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) 'get tasks for service Dim rptTasks As Repeater = e.Item.FindControl("rptTasks") rptTasks.DataSource = bllDept.getTasksForService(e.Item.DataItem("pk_dept_id")) rptTasks.DataBind() End Sub </code></pre> <p>Then, at itemupdating, I rebind rptDepts (which you said I shouldn't do</p> <pre><code>Public Sub lvProjects_OnItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewUpdateEventArgs) 'this item Dim itmProject As ListViewItem = lvProjects.Items(e.ItemIndex) 'rebind depts 'Dim rptDepts As Repeater = itmProject.FindControl("rptDepts") 'rptDepts.DataSource = bllDept.getServices() 'rptDepts.DataBind() 'update project bllProject.updateProject(itmProject, lblTest) 'unset edit status lvProjects.EditIndex = -1 'success message pnlFeedback.CssClass = "success" ltlFeedback.Text = "Project &lt;b&gt;" &amp; txtName.Text &amp; "&lt;/b&gt; was successfully updated." 'rebind bindProjects() End Sub </code></pre> <p>But in the bllProject.updateProject method, I need to be able to reference the checkboxes to save the changes to the DB</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload