// Populate the contacts select control private void PopulateSelect(string selectControlName, string selectControlFooterName, GridViewRowEventArgs e) { ProjectManagementDa projDA = new ProjectManagementDa(); CaisisSelect selectName = null; GridViewRow currentRow = e.Row; if (e.Row.RowIndex > -1) { selectName = currentRow.FindControl(selectControlName) as CaisisSelect; } else if (e.Row.RowType == DataControlRowType.Footer) { selectName = currentRow.FindControl(selectControlFooterName) as CaisisSelect; } if (selectName != null) { selectName.DataTextField = "Name"; selectName.DataValueField = "ContactId"; selectName.DataSource = projDA.GetAllContacts(); selectName.DataBind(); } }
private void PopulateCompletedByName() { ProjectManagementDa projDa = new ProjectManagementDa(); DataView contactsList = projDa.GetAllContacts().DefaultView; contactsList.Sort = "Name ASC"; FindCompletedByName.DataSource = contactsList; FindCompletedByName.DataBind(); }