Saturday 16 February 2013

Telerik RadGrid PageSize Combobox If not working.

If you are facing some problem like
  • When you are changing the the page size in Pagesize combobox. After that the grid not showing the the the page size that you are changed.
  • Then Do the following to solve this issue.
Step1:-
  • First Add a Telerik Rad GridView.

Here is the Source Code for Telerik RadGrid:-




    
      
     
       
        
         
        
       
       
        
          
        
       
       
        
         
        
       
       
        
         
        
       
       
         
          
         
       
    
  



Here is the C# Code:

protected void grdMerg_PageIndexChanged(object sender, GridPageChangedEventArgs e)
{
  RadGrid1.CurrentPageIndex = e.NewPageIndex;
  //Here bind the grid
}

protected void grdMerg_ItemCreated(object sender, GridItemEventArgs e)
{
  if (e.Item is GridPagerItem)
  {
    GridPagerItem pager = (GridPagerItem)e.Item;
    RadComboBox PageSizeComboBox = (RadComboBox)pager.FindControl("PageSizeComboBox");
    PageSizeComboBox.AutoPostBack = true;
    PageSizeComboBox.SelectedIndexChanged += new     RadComboBoxSelectedIndexChangedEventHandler(PageSizeComboBox1_SelectedIndexChanged);
   }
}

void PageSizeComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
  //Here bind the grid
}