I have a radGrid and I am doing client-side binding. And I am using
PagerStyle Mode="NextPrevAndNumeric"
So when client changes the pageSize and I am trying to pass that information to my webservicerequest to get the new set of items as per that new pageSize as below
function RadGrid1_Command(sender, args) {
//debugger;
args.set_cancel(true);
commandName = args.get_commandName();
var searchText = $('.SearchText').val();
var searchType = $('.SearchType').val();
var searchId = $('.SearchID').val();
var newPageSize = tableView.get_pageSize();
tableView.set_pageSize(newPageSize);
ISearchResultsService.getSearchResults(searchText, tableView.get_currentPageIndex(),
tableView.get_pageSize(), tableView.get_sortExpressions().toString(),
tableView.get_filterExpressions().toDynamicLinq(), searchType, searchId, updateGrid, onGetDataFailure2);
}
but I am manipulating columns in as below
function RadGrid1_RowDataBound(sender, args) {
var imgbutton = args.get_item().findElement("img1"); // find control
if (args.get_dataItem()["amazonThumbnailUrl"] != null && args.get_dataItem()["amazonThumbnailUrl"].toString() != "") {
imgbutton.src = args.get_dataItem()["amazonThumbnailUrl"].toString();
}
else {
imgbutton.src = "../Images/Listing/Thumbnails/" + args.get_dataItem()["ImageName"].toString();
}
}
But the HTML has only the initial pageSize and when it tries to rowDataBind the oldPageSize +1 it crashes since it cant find a value for Imgbutton in the above code, So what is work around for this situation to be able to change the pageSize in client side binding. I have also opened a support ticket, but thought posting here too for any workarounds?
Thanks
PagerStyle Mode="NextPrevAndNumeric"
So when client changes the pageSize and I am trying to pass that information to my webservicerequest to get the new set of items as per that new pageSize as below
function RadGrid1_Command(sender, args) {
//debugger;
args.set_cancel(true);
commandName = args.get_commandName();
var searchText = $('.SearchText').val();
var searchType = $('.SearchType').val();
var searchId = $('.SearchID').val();
var newPageSize = tableView.get_pageSize();
tableView.set_pageSize(newPageSize);
ISearchResultsService.getSearchResults(searchText, tableView.get_currentPageIndex(),
tableView.get_pageSize(), tableView.get_sortExpressions().toString(),
tableView.get_filterExpressions().toDynamicLinq(), searchType, searchId, updateGrid, onGetDataFailure2);
}
but I am manipulating columns in as below
function RadGrid1_RowDataBound(sender, args) {
var imgbutton = args.get_item().findElement("img1"); // find control
if (args.get_dataItem()["amazonThumbnailUrl"] != null && args.get_dataItem()["amazonThumbnailUrl"].toString() != "") {
imgbutton.src = args.get_dataItem()["amazonThumbnailUrl"].toString();
}
else {
imgbutton.src = "../Images/Listing/Thumbnails/" + args.get_dataItem()["ImageName"].toString();
}
}
But the HTML has only the initial pageSize and when it tries to rowDataBind the oldPageSize +1 it crashes since it cant find a value for Imgbutton in the above code, So what is work around for this situation to be able to change the pageSize in client side binding. I have also opened a support ticket, but thought posting here too for any workarounds?
Thanks