Nithya Rani
Top achievements
Rank 1
Nithya Rani
asked on 20 Mar 2013, 09:08 AM
Hi,
In my RadGrid 10 rows are displaying while clicking the linkbutton which is outside the grid my grid should display 20 rows per page. Any one can help me on this.
Regards,
Nithya
In my RadGrid 10 rows are displaying while clicking the linkbutton which is outside the grid my grid should display 20 rows per page. Any one can help me on this.
Regards,
Nithya
5 Answers, 1 is accepted
0
Jayesh Goyani
Top achievements
Rank 2
answered on 20 Mar 2013, 11:08 AM
Hello,
Thanks,
Jayesh Goyani
var grid = $find("<%=RadGrid1.ClientID %>"); var MasterTable = grid.get_masterTableView(); MasterTable .set_pageSize(YourNewPageSize); MasterTable.rebind(); Thanks,
Jayesh Goyani
0
Nithya Rani
Top achievements
Rank 1
answered on 20 Mar 2013, 01:40 PM
Hi Jayesh,
Its not working for me. What happening is i click the link button in the client click i have return the below code
Page is getting loaded so again for me its displaying same 10 rows only. its not updating
Regards,
Nithya
Its not working for me. What happening is i click the link button in the client click i have return the below code
function pager() {
var grid = $find("<%=RadGrid_orderstatus.ClientID %>");
var MasterTable = grid.get_masterTableView();
MasterTable.set_pageSize(30);
MasterTable.rebind();
}
<asp:LinkButton ID="LinkButton1" runat="server" class="btn-slide" OnClientClick="pager();return false;"></asp:LinkButton>
Page is getting loaded so again for me its displaying same 10 rows only. its not updating
Regards,
Nithya
0
Hello Nithya,
Please modify the logic like demonstrated below:
When the set_pageSize method is called there is no need to call rebind() as the set_pageSize method will call it for you. Give this approach a try and let us know how it went.
Kind regards,
Angel Petrov
the Telerik team
Please modify the logic like demonstrated below:
function pager() { var grid = $find("<%=RadGrid_orderstatus.ClientID %>"); var MasterTable = grid.get_masterTableView(); MasterTable.set_pageSize(30); }When the set_pageSize method is called there is no need to call rebind() as the set_pageSize method will call it for you. Give this approach a try and let us know how it went.
Kind regards,
Angel Petrov
the Telerik team
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 their blog feed now.
0
Nithya Rani
Top achievements
Rank 1
answered on 26 Mar 2013, 05:02 AM
Hi Angel Petrov,
Thanks Grid row count is changing but page is getting loaded which i don't want. Below is my scenario
In my Page i have header part and the grid part. When i click the arrow link header part should be collapsed and grid count should be changed to 30. When i click the arrow again my header should be expand and the grid row count should be 10. Below is my code after putting the grid row count functionality my collapse is not working.
JQuery
$(document).ready(function () {
$(".btn-slide").click(function () {
$("#panel").slideToggle("slow");
$(this).toggleClass("active");
var grid = $find("<%=RadGrid_orderstatus.ClientID %>");
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems();
if (row.length == 30) {
MasterTable.set_pageSize(10);
}
else {
MasterTable.set_pageSize(30);
}
return false;
});
});
HTML
<p class="slide">
<a href="#" class="btn-slide"> </a>
</p>
Regards,
Nithya
Thanks Grid row count is changing but page is getting loaded which i don't want. Below is my scenario
In my Page i have header part and the grid part. When i click the arrow link header part should be collapsed and grid count should be changed to 30. When i click the arrow again my header should be expand and the grid row count should be 10. Below is my code after putting the grid row count functionality my collapse is not working.
JQuery
$(document).ready(function () {
$(".btn-slide").click(function () {
$("#panel").slideToggle("slow");
$(this).toggleClass("active");
var grid = $find("<%=RadGrid_orderstatus.ClientID %>");
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems();
if (row.length == 30) {
MasterTable.set_pageSize(10);
}
else {
MasterTable.set_pageSize(30);
}
return false;
});
});
HTML
<p class="slide">
<a href="#" class="btn-slide"> </a>
</p>
Regards,
Nithya
0
Hi Nithya,
I am sorry to say but the behavior experienced is expected. When the page size of the grid is changed RadGrid needs to recreate it structure and fires a postback. As for why the expand functionality mentioned does not work after the postback it would be hard to tell without replicating the issue. Please revise the requirements and let us know if we could advice you further.
Kind regards,
Angel Petrov
the Telerik team
I am sorry to say but the behavior experienced is expected. When the page size of the grid is changed RadGrid needs to recreate it structure and fires a postback. As for why the expand functionality mentioned does not work after the postback it would be hard to tell without replicating the issue. Please revise the requirements and let us know if we could advice you further.
Kind regards,
Angel Petrov
the Telerik team
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 their blog feed now.