protected void ProcessDropList_SelectedIndexChanged(object sender, EventArgs e) { int proccess_id = int.Parse(ProcessDropList.SelectedItem.Value); PendingStaffsListView.DataSource = staffLogic.getPendingStaffs().Where(s => s.ProcessID == proccess_id); PendingStaffsListView.DataBind(); }
// public IEnumerable<Model.Staff> PendingStaffs; protected void Page_Load(object sender, EventArgs e) { // this.PendingStaffs = if (!IsPostBack) { ProcessDropList.DataSource = processLogic.GetAllProcesses(); ProcessDropList.DataBind(); PendingStaffsListView.DataSource = staffLogic.getPendingStaffs(); PendingStaffsListView.DataBind(); } foreach (var item in PendingStaffsListView.Items) { var toggle = item.FindControl("togglebox") as CheckBox; toggle.InputAttributes.Add("data-toggle", "toggle"); toggle.InputAttributes["data-onstyle"] = "success"; toggle.InputAttributes["data-offstyle"] = "danger"; } }