Advanced data binding with NeedDataSource event works perfectly for me when I need paging, sorting, grouping and filtering.
Below is the code snippet from your documentation:
The problem with that approach is that it needs to return all the data from database to let the grid make further data processing. What would you recommend to change in the code snippet above if there is a million customer records in database and you need to implement paging, sorting and filtering and grouping on each field?
Below is the code snippet from your documentation:
protected
void
RadGrid1_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
String ConnString = ConfigurationManager.ConnectionStrings[
"NorthwindConnectionString"
].ConnectionString;
SqlConnection conn =
new
SqlConnection(ConnString);
SqlDataAdapter adapter =
new
SqlDataAdapter();
adapter.SelectCommand =
new
SqlCommand(
"SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address FROM Customers"
, conn);
DataTable myDataTable =
new
DataTable();
conn.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
conn.Close();
}
RadGrid1.DataSource = myDataTable;
}
The problem with that approach is that it needs to return all the data from database to let the grid make further data processing. What would you recommend to change in the code snippet above if there is a million customer records in database and you need to implement paging, sorting and filtering and grouping on each field?