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

Timing-Problem with Paging in RadGrid

1 Answer 34 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Farouk
Top achievements
Rank 1
Farouk asked on 03 Feb 2009, 09:27 AM
hi,

here a little bit code to understand my problem:

function NextItem() { 
    var grid = $find("<%=Grid.ClientID %>"); 
    var masterTable = $find("<%= Grid.MasterTableView.ClientID %>"); 
 
    var indexSel = grid._selectedIndexes[0]; 
    var nextIndex = indexSel - 0 + 1; 
 
    if (masterTable.CurrentPageIndex == masterTable.PageCount - 1) { 
        if (indexSel == masterTable._getLastDataRow().sectionRowIndex) { 
            return
        } 
    } 
 
    if (nextIndex == masterTable.PageSize) { 
        masterTable.page("Next"); 
        $find("<%= RadAjaxManagerFolder.ClientID %>").ajaxRequest("Next"); 
 
        return
    } 
 
    masterTable.clearSelectedItems(); 
    masterTable.selectItem(nextIndex); 
this javascript is defined in a normal aspx page(main.aspx) and will be called by a radWindow, that is opened on the main.aspx. the grid is the on the main.aspx

<telerik:RadAjaxManager ID="RadAjaxManagerFolder" runat="server" OnAjaxRequest="RadAjaxManagerFolder_AjaxRequest"
</telerik:RadAjaxManager> 
here the ajaxmanager

protected void RadAjaxManagerFolder_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    switch (e.Argument) 
    { 
        case "Next"
            EmailFolderGrid.Items[0].Selected = true
            break
        case "Prev"
            EmailFolderGrid.Items[EmailFolderGrid.Items.Count - 1].Selected = true
            break
        default
            break
    } 
}  
this function is called by the javascript ($find("<%= RadAjaxManagerFolder.ClientID %>").ajaxRequest("Next");)

when i call the javascript function on the radWindow and it is the last entry in the grid selected so that it will paging, the grid don't page but the index will be set(first index selected). but when i debug this all (javascript with firebug and codebehind with VS 2008) all works fine!! and because of this, i think it's a timing problem but i don't why.

can anybody help me?? sorry for my bad english ;)...

1 Answer, 1 is accepted

Sort by
0
Farouk
Top achievements
Rank 1
answered on 03 Feb 2009, 09:48 AM
ah ok, i solved it by myself...

i take the page change from the javascript into the codebehind function... why easy if it works also difficult ;) ...
Tags
Ajax
Asked by
Farouk
Top achievements
Rank 1
Answers by
Farouk
Top achievements
Rank 1
Share this question
or