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

'Last' button in RadGrid problem

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Legalia
Top achievements
Rank 1
Legalia asked on 23 Feb 2009, 11:16 AM
Hi...
I have place First,Pervious,Next, & Last button in pagetemplate. when i am on last record, and then clicking on 'Next' button it does not display any record. displays 'No records to display'.

If i am on first page and click on 'Previous' button it displays first page. it works find.

my page template code is:

 <PagerTemplate> 
                                    <table id="tblPageMain" border="0" cellpadding="0" cellspacing="0" width="100%"
                                        <tr> 
                                            <td style="width: 200px;"
                                                <asp:Button ID="Button1" runat="server" OnClientClick="changePage('first'); return false;" 
                                                    CommandName="Page" CommandArgument="First" CssClass="PagerButton FirstPage" /> 
                                                <asp:Button ID="Button2" runat="server" OnClientClick="changePage('prev'); return false;" 
                                                    CommandName="Page" CommandArgument="Prev" CssClass="PagerButton PrevPage" /> 
                                                <span style="vertical-align: middle;">Page:</span> 
                                                <telerik:RadNumericTextBox ID="RadNumericTextBox1" Skin="Office2007" Width="25px" 
                                                    Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>' 
                                                    runat="server"
                                                    <ClientEvents OnValueChanged="RadNumericTextBox1_ValueChanged" OnKeyPress="RadNumericTextBox1_KeyPress" /> 
                                                    <NumberFormat DecimalDigits="0" /> 
                                                </telerik:RadNumericTextBox> 
                                                <span style="vertical-align: middle;">of 
                                                    <%# DataBinder.Eval(Container, "Paging.PageCount")%> 
                                                </span> 
                                                <asp:Button ID="Button3" runat="server" OnClientClick="changePage('next'); return false;" 
                                                    CommandName="Page" CommandArgument="Next" CssClass="PagerButton NextPage" /> 
                                                <asp:Button ID="Button4" runat="server" OnClientClick="changePage('last'); return false;" 
                                                    CommandName="Page" CommandArgument="Last" CssClass="PagerButton LastPage" /> 
                                            </td> 
                                            <td> 
                                                <div style="float: right;"
                                                    <asp:Panel runat="server" ID="NumericPagerPlaceHolder" /> 
                                                </div> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </PagerTemplate> 


Thanks,

1 Answer, 1 is accepted

Sort by
0
Legalia
Top achievements
Rank 1
answered on 23 Feb 2009, 11:50 AM
Hi...
i solved this by changing some javascript.

initially my page change function was :
function changePage(argument) 
        { 
                tableView.page(argument); 
        } 

then i changed it to
function changePage(argument) 
        { 
            if(!(argument=='next' && tableView.get_currentPageIndex()+1==tableView.get_pageCount()))             
                tableView.page(argument); 
        } 

now it works fine...
but if it is RadGrid problem, it should be soulved...

Thanks...




Tags
Grid
Asked by
Legalia
Top achievements
Rank 1
Answers by
Legalia
Top achievements
Rank 1
Share this question
or