protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GridView1.DataSource = AccesOT.GetAllOT("ordre"); GridView1.DataBind(); } }
protected void linkButton_Click(object sender, EventArgs e) { int totalRows = 0; int pageIndex = int.Parse((sender as LinkButton).CommandArgument); pageIndex -= 1; GridView1.PageIndex = pageIndex; GridView1.DataSource = AccesOT.GetAllOT(pageIndex, GridView1.PageSize, out totalRows); GridView1.DataBind(); DatabindRepeater(pageIndex, GridView1.PageSize, totalRows); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int totalRows = 0; GridView1.DataSource = AccesOT.GetAllOT(GridView1.PageIndex, GridView1.PageSize, out totalRows); GridView1.DataBind(); DatabindRepeater(GridView1.PageIndex, GridView1.PageSize, totalRows); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int totalRows = 0; GridView1.DataSource = AccesOT.GetAllOT(GridView1.PageIndex, GridView1.PageSize, GridView1.Attributes["CustomSortField"], GridView1.Attributes["CustomSortDirection"], out totalRows); GridView1.DataBind(); DatabindRepeater(GridView1.PageIndex, GridView1.PageSize, totalRows); } }
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e) { SortDirection sortDirection = SortDirection.Ascending; string sortField = string.Empty; SortGridView((GridView)sender, e, out sortDirection, out sortField); string strSortDirection = sortDirection == SortDirection.Ascending ? "ASC" : "DESC"; int totalRows = 0; GridView1.DataSource = AccesOT.GetAllOT(GridView1.PageIndex, GridView1.PageSize, e.SortExpression, strSortDirection, out totalRows); GridView1.DataBind(); DatabindRepeater(GridView1.PageIndex, GridView1.PageSize, totalRows); }
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e) { SortDirection sortDirection = SortDirection.Ascending; string sortField = string.Empty; SortGridView((GridView)sender, e, out sortDirection, out sortField); string strSortDirection = sortDirection == SortDirection.Ascending ? "ASC" : "DESC"; GridView1.DataSource = AccesOT.GetAllOT(e.SortExpression + " " + strSortDirection); GridView1.DataBind(); Response.Write("Sort Expression = " + e.SortExpression); Response.Write("<br />"); Response.Write("Sort Direction = " + sortDirection.ToString()); }