/// <summary> /// Given the list of QHS faculty, populates the "Biostatistician" form /// on the botton, with their associated percentage, fee, how many /// years of grant, and note/commentary. /// </summary> /// <param name="grantBiostat"></param> private void BindGridViewBiostat(ICollection <GrantBiostat> grantBiostat) { DataTable dt = CreateBiostatTable(grantBiostat, true); GridViewBiostat.DataSource = dt; GridViewBiostat.DataBind(); }
/// <summary> /// Deletes "Biostatistician" (QHS Faculty/Staff) section row based on row selected to delete. /// Actually deletes all rows and regenerates entire "Biostatistician" section besides the /// index that was specifed to delete. /// </summary> /// <param name="deleteRowIndex">Row to delete.</param> private void BindGridViewBiostat(int deleteRowIndex) { DataTable dt = CreateBiostatTable(null, false); DataRow dr; foreach (GridViewRow gv in GridViewBiostat.Rows) { if (gv.RowIndex != deleteRowIndex) { dr = dt.NewRow(); Label rowId = gv.FindControl("lblId") as Label; DropDownList ddl = gv.FindControl("ddlBiostats") as DropDownList; TextBox txtPct = gv.FindControl("TextBoxPct") as TextBox; TextBox txtFee = gv.FindControl("TextBoxFee") as TextBox; TextBox txtNote = gv.FindControl("TextBoxNote") as TextBox; TextBox txtYear = gv.FindControl("TextBoxYear") as TextBox; dr[0] = rowId.Text; dr[1] = ddl.SelectedValue; dr[2] = txtPct.Text; dr[3] = txtFee.Text; dr[4] = txtYear.Text; dr[5] = txtNote.Text; dt.Rows.Add(dr); } } if (dt.Rows.Count == 0 || deleteRowIndex < 0) { dr = dt.NewRow(); dt.Rows.Add(dr); } GridViewBiostat.DataSource = dt; GridViewBiostat.DataBind(); }