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

How to fire a javascript on change of Page size drop down.

1 Answer 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kalyan gupta
Top achievements
Rank 1
kalyan gupta asked on 25 Oct 2010, 03:22 PM
Hi @

I am using Telerik Rad Grid in one of my applications.

Now When ever I change the page size of Telerik RadGrid or when ever i click on Pagination. I need to call a javascript function.

I tried to find the page size Rad combo which is used inside Grid and attaching an event which would call a javascript. But It was not working.

Please let me know how to achieve this.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 27 Oct 2010, 12:50 PM
Hi kalyan gupta,

You can use the following approach:

C#

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridPagerItem)
    {
        RadComboBox c = e.Item.FindControl("PageSizeComboBox") as RadComboBox;
        c.OnClientSelectedIndexChanged = "handlerName";
    }
}

Javascript

function handlerName(sender, args)
{
    // put your code here
    // ........
    alert("OnClientSelectedIndexChanged");
 
    // execute the default handler afterwards, which change the page size
    Telerik.Web.UI.Grid.ChangePageSizeComboHandler(sender, args);  
}


Greetings,
Dimo
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
General Discussions
Asked by
kalyan gupta
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or