Turn off Allowpaging with a checkbox on the page

3 posts, 0 answers
  1. TS
    TS avatar
    5 posts
    Member since:
    Apr 2010

    Posted 03 Aug 2015 Link to this post

    I want to be able to have a checkbox on the page that when checked, the RadGrid uses paging, when unchecked, the RadGrid shows all results. How can I accomplish this? 

     

    Thank you for your help.

  2. Eyup
    Admin
    Eyup avatar
    3699 posts

    Posted 06 Aug 2015 Link to this post

    Hi Todd,

    You can use the following approach to achieve this requirement:
    <asp:CheckBox ID="CheckBox1" runat="server" Text="Disable paging"
        Checked="true" OnCheckedChanged="CheckBox1_CheckedChanged"
        AutoPostBack="true" />
    C#:
    protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox checkBox = sender as CheckBox;
        checkBox.Text = (checkBox.Checked ? "Disable" : "Enable") + " paging";
        RadGrid1.AllowPaging = checkBox.Checked;
        RadGrid1.Rebind();
    }

    Hope this helps. Please give it a try and let me know if it works for you.

    You can also ajaxify these controls to increase the user performance.

    Regards,
    Eyup
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. TS
    TS avatar
    5 posts
    Member since:
    Apr 2010

    Posted 06 Aug 2015 in reply to Eyup Link to this post

    This works great! Thanks so much
Back to Top