Good day,

I am having problem with the saving. all i want is to save multiple records at once. i used user define table in sql server 2008. my stored proc seems be right coz i already tested it..

my problem is that once i selected a record from the first page and move to another page or so.. my selected value seems to be not read in the gridview. all record that they read is the selected record on the active page..

i need some help regarding this..
below is my code for reading the value of selected value..

  gvTaggingAccounts.AllowPaging = false; 

        #region original codes
        DataTable dtTable = new DataTable("AcctTaggingType");
        dtTable.Columns.Add("AccountNum", typeof(Int32));
        dtTable.Columns.Add("AccountName", typeof(string));

        DataRow dtRow;

            foreach (GridViewRow grRow in gvTaggingAccounts.Rows)
                CheckBox chkStatus = (CheckBox)grRow.FindControl("chkTypes");

                if (chkStatus.Checked)
                    //getting the previous record form the gridview

                 dtRow = dtTable.NewRow();

                    //just to return to the first page of the gridview


                 dtRow[0] = grRow.Cells[1].Text;
                 dtRow[1] = grRow.Cells[2].Text;

                   // RememberCheckedValues();

5 Years
Discussion Span
Last Post by nakor77

The gridview, when paging is being used, does not load all data from the database at once. It only loads what is currently being displayed. So the data you selected on any previous page no longer exists as far as the GridView is concerned. If you want to update data across multiple pages you are going to need to store the data that has been selected in some way, most likely in a session variable. Then when you make the actual update you'll use the data from the Session variable rather than from the GridView.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.