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

Telerik RadGrid - Customizing the Pager - Page Index Event not Raised

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
april
Top achievements
Rank 1
april asked on 31 Oct 2010, 10:07 AM

We would to follow the customizing of the pager for the RadGrid as shown in the example on this url:


http://demos.telerik.com/aspnet-ajax/grid/examples/programming/customizingpager/defaultcs.aspx

However, using this code, the MyPager class doesn't cause the PageIndexChanged event to be fired. We have some validations on the Page index changed based on which the event can be cancelled or allowed. I would like to know how to implement this functionality.

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 04 Nov 2010, 09:28 AM
Hello april,

If you want the mentioned button to fire the PageIndexChanged event, instead of directly changing the CurrentPageIndex in its Click event handler, you need to fire the page command:

private void BtnClick(object sender, EventArgs e)
{
    if (this.textBox.Text.Trim() != "")
    {
        this.tableView.GetItems(GridItemType.Pager)[0].FireCommandEvent("Page", (int.Parse(this.textBox.Text) - 1).ToString());
    }
}

I hope this helps.

Sincerely yours,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
april
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or