I’m using RadGrid for ASP.NET AJAX with LinqDataSource.
I’m amazed with amount of functionality I can accomplish in this combination with just declarative programming in ASCX and without single line in code behind.
What I really like is that sorting and paging is done on SQL server. Here is example of T-SQL I got from SQL Server Profiler:
exec sp_executesql N'SELECT [t1].[Id], [t1].[ParentId], [t1].[Name]
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY [t0].[Name]) AS [ROW_NUMBER], [t0].[Id], [t0].[ParentId], [t0].[Name]
FROM [dbo].[Things] AS [t0]
) AS [t1]
WHERE [t1].[ROW_NUMBER] BETWEEN @p0 + 1 AND @p0 + @p1
ORDER BY [t1].[ROW_NUMBER]',N'@p0 int,@p1 int',@p0=8,@p1=8
Now, I would like to utilize RadGrid filtering with AllowFilteringByColumn="True".
When I execute some filter I got this T-SQL code in SQL Profiler:
SELECT TOP (2147483647) [t0].[Id], [t0].[ParentId], [t0].[Name]
FROM [dbo].[Things] AS [t0]
ORDER BY [t0].[Name]
This means that in this case filtering and paging is not done by SQL server, but on web server with in RadGrid control. In this case it is possible that huge amount of rows is sent form SQL to web server and I would like to avoid this too. (I see that with canretrievealldata="False" I can preserve SQL Server paging, but in this case filtering is preformed only over current page, so this is not a solution for me.)
If I understand correctly by default data filtering is executed with in RadGrid control with LINQ.
I would like to use LINQ to SQL for this in my project because I think it is more optimal.
Do I miss something here?
What is best way to accomplish use of LINQ to SQL with RadGrid for ASP.NET AJAX and LinqDataSource for filtering also?