Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
protected void gvFiling_PageIndexChanging(Object sender, GridViewPageEventArgs e)
        {
            List<DataKey> datakeys = new List<DataKey>();
            foreach (GridViewRow row in gvFiling.Rows)
            {
                if (((CheckBox)row.FindControl("cbxApply")).Checked)
                {
                    datakeys.Add(gvFiling.DataKeys[row.RowIndex]);
                }
                else
                    datakeys.Remove(gvFiling.DataKeys[row.RowIndex]);
            }
            if (SessionWrapper.RelatedFilingsRecordsList != null)
            {
                List<DataKey> sessionList = new List<DataKey>();
                sessionList = SessionWrapper.RelatedFilingsRecordsList;

                foreach (DataKey dk in datakeys)
                {
                    foreach (GridViewRow row in gvFiling.Rows)
                    {
                        sessionList.Add(dk);
                    }
                }
                SessionWrapper.RelatedFilingsRecordsList = sessionList;
            }
            else
                SessionWrapper.RelatedFilingsRecordsList = datakeys;
        }

C#
public static List<System.Web.UI.WebControls.DataKey> RelatedFilingsRecordsList
    {
        get
        {
            if (HttpContext.Current.Session["RelatedFilingsRecordsList"] != null)
                return (List<System.Web.UI.WebControls.DataKey>)HttpContext.Current.Session["RelatedFilingsRecordsList"];
            else
                return null;
        }
        set
        {
            HttpContext.Current.Session["RelatedFilingsRecordsList"] = value;
        }
    }
Posted
Comments
Not clear.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900