I got a problem when using the "ClientSettings.ClientEvents.OnCommand".
I want to catch the event when I click the pager number and change the pagesize by the dropdownlist. I looked up the document and found the using "ClientSettings.ClientEvents.OnCommand", so I wrote my code like this:
c#:
listGrid.ClientSettings.ClientEvents.OnCommand =
"RaiseCommand";
HTML:
function RaiseCommand(sender, eventArgs) {
var result = eventArgs.get_commandName();
switch (result) {
case "Page":
{
ShowCancelBtn();
break;
}
case "PageSize":
{
ShowCancelBtn();
break;
}
}
But I found that when I change the pagesize with the dropdownlist , the pager numbers changes immediately before the grid data loading start!
For Example: when I use the pagesize "10" , the page number is "1,2,3" and total record count is 30 .when I change to pagesize"20", the page number changes immediately to "1,2" before the grid data began load.
In other word , the page numer is been calculate first and been shown, and then the grid data began load. I don't want it works like that. I thnk there must be something wrong with the "ClientSettings.ClientEvents.OnCommand", It causes the wrong order bettween page number shown and dataload. I need your help, team.