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

After upgrading from version 2011 to 2013 custom paging has stopped working properly

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 30 Jul 2013, 03:46 PM
I have client-side grid inherited from RadGrid. It was fully functional, but after upgrade to the newest Telerik version it stopped working properly.

For instance, I have a custom pager: it's RadCombobox created like this:
protected override void OnItemEvent(GridItemEventArgs e)
{
    if (e.EventInfo is GridInitializePagerItem && e.Item is GridPagerItem)
    {
        e.Canceled = true;
        B4GridClientPager = new B4GridClientPager((e.EventInfo as GridInitializePagerItem).PagingManager, e.Item.OwnerTableView, Page, MaxNumberOfRows);
        (e.Item as GridPagerItem).PagerContentCell.Controls.Add(B4GridClientPager);
    }
}

This event is fired twice as we all know :) and before it was not a problem, but now after I select value in the pager and SelectedIndexChanged event happens - the values in the combobox are duplicated on page reload! No matter if I turn viewstate on or off, for combobox itself or the grid in common...

More code I previously had to write to make custom paging work:

private void RadGridDebriefitClientPager_Init(object sender, EventArgs e)
{
    var radComboBox = sender as RadComboBox;
 
    if (Page.IsPostBack)
    {
        if (HttpContext.Current.Request.Params["__EVENTTARGET"] != null &&
            HttpContext.Current.Request.Params["__EVENTTARGET"] == radComboBox.ClientID)
        {
            int pageSize;
 
            if (int.TryParse(HttpContext.Current.Request.Params["__EVENTARGUMENT"], out pageSize))
            {
                if (pageSize > 0)
                {
                    _tableView.PageSize = pageSize;
                    _tableView.OwnerGrid.PageSize = pageSize;
                    _tableView.CurrentPageIndex = 0;
                    _tableView.OwnerGrid.CurrentPageIndex = 0;
                    //tableView.Rebind();
                }
            }
        }
    }
}

and it was called by using this:
function RadGridDebriefitClientPager_SelectedIndexChanged(sender, eventArgs) {
    __doPostBack(sender.get_id(), sender.get_value());
}

Autopostback property of combo is set to false, so this event fires only.

1 Answer, 1 is accepted

Sort by
0
Accepted
Antonio Stoilkov
Telerik team
answered on 02 Aug 2013, 07:44 AM
Hi Alexander,

You have posted the same question in a support ticket and you could decide where our communication will continue. Note that we recommend avoiding posting duplicate questions so the support team could improve their response time.

Regards,
Antonio Stoilkov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Alexander
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or