Exemple #1
0
        protected void GridviewBind()
        {
            Session["cachedProfile"]        = ReceiptDataAccessClass.LoadProfileReceipts(ReceiptConstants.UserProvCode, 12);
            ReceiptTableGridview.DataSource = Session["cachedProfile"];
            ReceiptTableGridview.DataBind();

            if (Session["cachedProfile"] != null)
            {
                ReceiptTableGridview.UseAccessibleHeader    = true;
                ReceiptTableGridview.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }
Exemple #2
0
        protected void ReceiptTableGridview_PageIndexChanged(object sender, GridViewPageEventArgs e)
        {
            if (Session["sortedProfile"] != null)
            {
                ReceiptTableGridview.DataSource = Session["sortedProfile"];
            }
            else
            {
                ReceiptTableGridview.DataSource = Session["cachedProfile"];
            }

            ReceiptTableGridview.PageIndex = e.NewPageIndex;
            ReceiptTableGridview.DataBind();
            // Session["cachedProfile"] = ReceiptTableGridview.DataSource;
        }
Exemple #3
0
        protected void ReceiptTableGridview_Sorting(object sender, GridViewSortEventArgs e)
        {
            DataTable InfoToBeSorted = new DataTable();
            //Retrieve the table from the session object.
            DataSet ds = Session["cachedProfile"] as DataSet;

            if (ds != null)
            {
                InfoToBeSorted = ds.Tables[0];

                //Sort the data.
                InfoToBeSorted.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression);
                ReceiptTableGridview.DataSource = InfoToBeSorted; // Session["cachedProfile"];
                ReceiptTableGridview.DataBind();
                Session["sortedProfile"] = ReceiptTableGridview.DataSource;
            }
        }