View Complete Post
The issue is two fold in my ASP.NET Web Application. I need to use a custom Distinct() via LINQ to SQL, and then assign thevar as a DataSource to a GridView. If I use the custom Distinct that implements IEqualityComparer, I get "Unsupported overload used for query operator 'Distinct'" exception. but if i somehow get past this, i get "The data source does not support server-side data paging" exception on GridView.DataBind(). here is the code:
(from emp in wsq.LIT_Active_Employees
where (String.IsNullOrEmpty(ssFirstName.Text) ? (emp.FIRST_NAME == null || emp.FIRST_NAME.StartsWith(String.Empty)) : emp.FIRST_NAME.Contains(ssFirstName.Text)) &&
(String.IsNullOrEmpty(ssLastName.Text) ? (emp.LAST_NAME == null || emp.LAST_NAME.StartsWith(String.Empty)) : emp.LAST_NAME.Contains(ssLastName.Text)) &&a
When I bind a gridview to an sqldatasource, paging works fine, but when I bind it to a datasource using a vb sub-end sub, I get the error The GridView 'GridView1' fired event PageIndexChanging which wasn't handled.
I have looked at some solutions on the internet but cannot get them to work.
Does anyone know of a solution to this?