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

[Solved] paging, sorting not working

5 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 20 Sep 2009, 11:59 PM
i have this on the front-end
<telerik:RadGrid AutoGenerateColumns="true" ID="RadGrid1" Visible="false" MasterTableView-EnableNoRecordsTemplate="true" 
                            Width="100%" AllowFilteringByColumn="True" AllowSorting="True" OnSortCommand="RadGrid1_SortCommand" 
                            PageSize="15" ShowStatusBar="true" AllowPaging="True" OnPageIndexChanged="RadGrid1_PageIndexChanged"   
                            runat="server" GridLines="None" OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated" 
                            OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated">  
                        <PagerStyle Mode="NextPrevAndNumeric" />  
                        <MasterTableView Summary="testing" ></MasterTableView>  
                    </telerik:RadGrid> 
and on the back-end i have
Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource  
        Select Case tmp_comp_report_ID  
            Case 19  
                GetSectionReport(19, CInt(Request.QueryString.Item("reportid")), CInt(ddl_Stores.SelectedValue.ToString), ddl_Departments.SelectedItem.Text.ToString, 0, "")  
            Case 24  
                GetSectionReport(24, CInt(Request.QueryString.Item("reportid")), CInt(ddl_Stores.SelectedValue.ToString), ddl_Departments.SelectedItem.Text.ToString, 1, "")  
        End Select 
    End Sub 
 
    Protected Sub RadGrid1_PageIndexChanged(ByVal source As ObjectByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles RadGrid1.PageIndexChanged  
        Select Case tmp_comp_report_ID  
            Case 19  
                GetSectionReport(19, CInt(Request.QueryString.Item("reportid")), CInt(ddl_Stores.SelectedValue.ToString), ddl_Departments.SelectedItem.Text.ToString, 0, "")  
            Case 24  
                GetSectionReport(24, CInt(Request.QueryString.Item("reportid")), CInt(ddl_Stores.SelectedValue.ToString), ddl_Departments.SelectedItem.Text.ToString, 1, "")  
        End Select 
    End Sub 
 
    Protected Sub RadGrid1_SortCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridSortCommandEventArgs) Handles RadGrid1.SortCommand  
        Select Case tmp_comp_report_ID  
            Case 19  
                GetSectionReport(19, CInt(Request.QueryString.Item("reportid")), CInt(ddl_Stores.SelectedValue.ToString), ddl_Departments.SelectedItem.Text.ToString, 0, "")  
            Case 24  
                GetSectionReport(24, CInt(Request.QueryString.Item("reportid")), CInt(ddl_Stores.SelectedValue.ToString), ddl_Departments.SelectedItem.Text.ToString, 1, "")  
        End Select 
    End Sub 
 
    Protected Sub RadGrid1_ColumnCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated  
        e.Column.HeaderText = Replace(e.Column.HeaderText.ToString, "_"" ")  
        e.Column.AutoPostBackOnFilter = True 
    End Sub 
everything works fine except for paging and sorting. when i click on paging it has javascript error saying object required and sorting also has that. Can you help me please. thank you very much for your time.

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Sep 2009, 10:22 AM
Hello Duy,

Please have in mind that simple data-binding can be used in simple cases when you do not require the grid to perform complex operations such as paging and sorting. For advanced features such as those, RadGrid must be bound through the NeedDataSource event.
More information about advanced data-binding is available in the following link:
http://www.telerik.com/help/aspnet-ajax/grdadvanceddatabinding.html

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
appdev
Top achievements
Rank 1
answered on 21 Sep 2009, 10:40 AM
that's how i got the data into the grid by using needdatasource, but i do want to use sorting and paging,i can change the size of pagingsize but not the page number or sorting. if u know what was wrong please let me know really appreciate it. thanks.
0
Pavlina
Telerik team
answered on 21 Sep 2009, 11:07 AM
Hi Duy,

I checked your account and it occurs that you have opened support ticket and several forum threads for the same thing. It is highly recommended that you keep related questions in one support thread or a forum post, so that we can easily keep track of your support history and provide better answers in a shorter time.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
appdev
Top achievements
Rank 1
answered on 22 Sep 2009, 10:50 AM
i have attached the project on the support ticket please help me with it thanks.
0
Pavlina
Telerik team
answered on 22 Sep 2009, 03:36 PM
Hello Duy,

I have already answered your support ticket.

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
appdev
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
appdev
Top achievements
Rank 1
Share this question
or