private void txtUserName_TextChanged(object sender, EventArgs e) { DataTable dt = new DataTable(); dt = balUser.GetAllUserFilter(txtUserName.Text); PopulateGrid(dt); }
private void LoadGridFilter(object sender, EventArgs e) { dgvUser.Rows.Clear(); dgvUser.DataSource = null; DataTable dt = new DataTable(); dt = balUser.GetAllUserFilter(txtSearch.Text); for (int i = 0; i < dt.Rows.Count; i++) { dgvUser.Rows.Add(); dgvUser.Rows[i].Cells["colUserID"].Value = dt.Rows[i]["userid"].ToString(); dgvUser.Rows[i].Cells["colUsername"].Value = dt.Rows[i]["UserName"].ToString(); dgvUser.Rows[i].Cells["colRoleID"].Value = dt.Rows[i]["RoleID"].ToString(); } }