示例#1
0
        protected void fillUsersGrid()
        {
            // Fill the grid and save it in viewState
            allUsers = BUsers.getAllUserDTO();
            ViewState["allUsers"] = allUsers;

            GridMainDetailsUser.DataSource = allUsers;
            GridMainDetailsUser.DataBind();
        }
示例#2
0
 protected void GridMainDetailsUser_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridMainDetailsUser.PageIndex = e.NewPageIndex;
     if (ViewState["filterUsers"] != null)
     {
         allUsers = (List <UserDTO>)ViewState["filterUsers"];
         GridMainDetailsUser.DataSource = allUsers;
         GridMainDetailsUser.DataBind();
     }
     else
     {
         fillUsersGrid();
     }
 }
示例#3
0
        protected void filterUsers()
        {
            // 1.- Get the last data source from viewstate
            allUsers = (List <UserDTO>)ViewState["allUsers"];

            // 2.- Filter by Region if value is not -1
            if (DropDownRegion.SelectedValue != "-1")
            {
                allUsers = BUsers.filterByRegion(allUsers, DropDownRegion.SelectedItem.Text);
            }

            // 3.- Filter by KeyWord
            allUsers = BUsers.filterByNameLastNameDni(allUsers, TextBoxSearch.Text);

            // 4.- Bind grid and save it in viewstate
            ViewState["filterUsers"]       = allUsers;
            GridMainDetailsUser.DataSource = allUsers;
            GridMainDetailsUser.DataBind();
        }