예제 #1
0
        protected void BindDataToGridView()
        {
            //get data from database
            DataTable dt = AdminDb.GetAllUsers(tbFindUser.Text, ddActiveFilter.SelectedValue);
            //cast to dataview for sorting and filtering
            DataView dv = (DataView)dt.DefaultView;

            //sort by session expr and direction
            dv.Sort = Session["SortExpr"].ToString() + Session["SortDirection"].ToString();
            //rebind with new sorted data
            gvUsers.DataSource = dv;
            gvUsers.DataBind();
        }
예제 #2
0
 public List <UserDetails> GetAllUsers()
 {
     return(adminDb.GetAllUsers());
 }