Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i move data from repeater control in next previous button click..
Please Help Me...
thank you
Posted
Comments
Sandeep Mewara 30-May-11 2:03am    
Can you elaborate a little more... it would help what you are working on, scenario.

    public int CurrentPage
    {
        get
        {
            //get current page number
            object obj = this.ViewState["_CurrentPage"];

            if (obj == null)
            {
                return 0;
            }
            else
            {
                return (int)obj;
            }
        }
        set
        {
            //set in viewstate the current page number
            this.ViewState["_CurrentPage"] = value;
        }
    }



protected void imgNextlist_Click(object sender, ImageClickEventArgs e)
    {
        //go to next page
        CurrentPage += 1;
        DataTable dv = new DataTable();
        dv = (DataTable)ViewState["dt"];

        GetItems(dv);
    }
    protected void imgPrelist_Click(object sender, ImageClickEventArgs e)
    {
        //back to previous page
        CurrentPage -= 1;
        DataTable dv = new DataTable();
        dv = (DataTable)ViewState["dt"];

        GetItems(dv);
    }


//In Loading method of Repeater write like this,-


PagedDataSource objPds = new PagedDataSource();

        //set number of pages will appear ddlSort
        // objPds.PageSize = 3;
        objPds.PageSize = int.Parse(ddlSort.SelectedValue.ToString());
        objPds.DataSource = dv.DefaultView;
        objPds.AllowPaging = true;
        int count = objPds.PageCount;


        objPds.CurrentPageIndex = CurrentPage;

 RptShowData.DataSource = objPds;
        RptShowData.DataBind();


Hope this can Help you.
 
Share this answer
 
Comments
Sunasara Imdadhusen 31-May-11 0:16am    
My vote of 5!
 
Share this answer
 

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