This is a migrated thread and some comments may be shown as answers.

Paging not working

5 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Appu
Top achievements
Rank 1
Appu asked on 26 Jun 2009, 05:34 PM
Hi
 I hav one problem for my Radgrid paging..

        while calling the below code the paging or page index changed does not working. As a result i cannot move to next page from my first page displayed as well.

My code snipper is below:
 protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
      RefreshCombos();
      
    }

    //To refresh the resultset
    private void RefreshCombos()
    {
        objDA= new ClassDA();
        DataTable dt= objDA.GetDetails();

        RadGrid1.DataSource =dt;
        RadGrid1.MasterTableView.Rebind();
        
    }

I am used the code what ever it is given by the Telerik help page for filtering controls. But it is not working fine while page moving

Thanks
Appu

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jun 2009, 07:42 AM
Hi Appu,

If you are using inbuilt Paging you do not need to Rebind the Grid in the PreRender event. When you rebind the Grid on each and every PostBack the CurrentPageIndex of the Grid will be set to the first page.

Shinu
0
Appu
Top achievements
Rank 1
answered on 29 Jun 2009, 07:54 AM
Hi shinu..
        Thanx But the filtering will not work suppose we havnt given pre-render event. Thats is the problem i am facing.


Regards,
Appu
0
Shinu
Top achievements
Rank 2
answered on 29 Jun 2009, 08:03 AM
Hi Appu,

Are you trying to implement basic Filtering? If so you just need to bind the Grid using AdvanceDataBinding techniques.
Advanced Data Binding

Shinu
0
Appu
Top achievements
Rank 1
answered on 29 Jun 2009, 09:24 AM
Hi

   I am not using basic filtering instead of i am using the below code

 string filterExpression = "";

        if (e.Value != "All")
        {
            filterExpression = "([Firm_name] = '" + e.Value + "')";
        }
        else
        {
            filterExpression = "([Firm_name] <> '')";
        }

         RadGrid1.MasterTableView.FilterExpression = filterExpression;
      
once ofter the above code is over i cal RefreshCombo function

//To refresh the resultset
    private void Refresh()
    {

        objDataAccess = new DataAccess();
        contactsTable = objDataAccess.GetContacts();

        RadGrid1.DataSource = contactsTable;
        RadGrid1.MasterTableView.Rebind();
        
        
    }

This all done for my filtering. But i am facing the problem in my tradional grouping and paging. Soon after the filtering is over..

Hope u could understand

Regards,
Appu






0
Daniel
Telerik team
answered on 02 Jul 2009, 11:30 AM
Hello Appu,

You don't need to set the filtering expression on every postback because this resets the page index. This way you can't reach the second page at all (as already mentioned by Shinu).

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Appu
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Appu
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or