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

Rad Grid Pagination and Sorting,

1 Answer 12 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mathieu cupryk
Top achievements
Rank 1
mathieu cupryk asked on 02 Feb 2019, 07:28 PM

Is there any examples of Rad grids binding to stored procedures with pagination and sorting?

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Feb 2019, 04:45 PM
Hello Mathieu,

Paging and sorting are done by the grid in the front-end server memory - it requests all the data from the data source and then filters, pages, groups and sorts as needed.

We don't have examples with stored procedures because they are hard to run and copy, so they serve as rather poor examples. Nevertheless, you should be able to use a standard <asp:SqlDataSource> control to bind to a stored procedure by setting SelectCommandType="StoredProcedure". Then, you only need to set the DataSourceID property of the grid to the ID of the SqlDataSource instance.

An alternative is to use the NeedDataSource server event of the grid and call the stored procedure from your own C#/VB code. Here are more details on using this event and an example that calls an SQL server (even through it is not a stored proc): https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-binding/understanding-data-binding/server-side-binding/advanced-data-binding-(using-needdatasource-event).


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
mathieu cupryk
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or