how to redirect to a current page after refreshing grid pannel?

  1. #1

    how to redirect to a current page after refreshing grid pannel?

    Hi,
    I have 40 record in database. But I am displaying 10 record in each page in store grid by using grid pannel.Similarlly, I am using Ajax for events. But the problem is when I refresh the page or grid, it shows first record in first page. how can I get current page data when refreshing data? How can I avoid this problem, anybody can help me...
    code:

    protected void Refresh_Click(object sender, StoreRefreshDataEventArgs e)
            {
                Refresh();
                pgtCombo.PageIndex = Convert.ToInt32(Session["pgIndex"]); 
                pgtCombo.PageSize = Convert.ToInt32(Session["pgSize"]);           
                Session["pgIndex"] = string.Empty;
                Session["pgSize"] = string.Empty;
            }
    
            protected void Refresh()
            {
                try
                {                
                    Session["pgIndex"] = Convert.ToInt32(pgtCombo.PageIndex.ToString());
                    Session["pgSize"] = Convert.ToInt32(pgtCombo.PageSize.ToString());               
                    string name = Convert.ToString(cmbSearch.SelectedItem.Value);
                    SqlConnection con = new SqlConnection(@"Integrated Security=SSPI;Initial Catalog=SUBBU; Data Source=vsspldev-09\SQLEXPRESS");
                    con.Open();
                    SqlCommand cmd = new SqlCommand();
                    cmd.CommandText = string.Format("SELECT * FROM EMPLOYEE");
                    cmd.CommandType = CommandType.Text;
                    cmd.Connection = con;
                    cmd.ExecuteNonQuery();
                    DataSet ds = new DataSet();
                    SqlDataAdapter daa = new SqlDataAdapter(cmd);
                    daa.Fill(ds, "EMPLOYEE");
                    con.Close();
                    this.stoCombo.DataSource = ds;
                    this.stoCombo.DataBind();
                }
                catch
                {
                    throw new Exception("Connection Error!");
                }
            }
    Last edited by geoffrey.mcgill; Nov 10, 2010 at 11:02 PM. Reason: please use [CODE] tags
  2. #2
    Hi,

    Please post any technical support questions in the Help forum.

    Please use [CODE ] tags, see

    http://forums.ext.net/showthread.php...ing-New-Topics

    http://forums.ext.net/showthread.php...ation-Required
    Last edited by geoffrey.mcgill; Nov 10, 2010 at 11:01 PM.

Similar Threads

  1. Replies: 2
    Last Post: Dec 22, 2011, 2:45 PM
  2. Replies: 1
    Last Post: Aug 12, 2011, 1:35 PM
  3. Redirect to another page?
    By mattwoberts in forum 1.x Help
    Replies: 3
    Last Post: Dec 17, 2010, 1:54 PM
  4. Replies: 1
    Last Post: Nov 18, 2010, 5:21 AM
  5. [CLOSED] Grouping doesn't group entire grid data...just current page.
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 05, 2010, 2:34 PM

Tags for this Thread

Posting Permissions