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

Turn off Allowpaging with a checkbox on the page

2 Answers 16 Views
Grid
This is a migrated thread and some comments may be shown as answers.
TS
Top achievements
Rank 1
TS asked on 03 Aug 2015, 08:07 PM

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 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Aug 2015, 09:26 AM
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
0
TS
Top achievements
Rank 1
answered on 06 Aug 2015, 03:10 PM
This works great! Thanks so much
Tags
Grid
Asked by
TS
Top achievements
Rank 1
Answers by
Eyup
Telerik team
TS
Top achievements
Rank 1
Share this question
or