You will need to use:
gridUsers.VirtualItemCount = Queryable.Count(query); gridUsers.DataSource = Enumerable.ToList(query);
Dynamic typing does not do extension methods. (I'm not quite sure why. The compiler writes quite a lot of information about the call site - in general, it will have to store all the using directives associated with the call site, and it also slows down dynamic linking, which can be a problem they are trying to avoid. Maybe it was too much work for too little good.)
EDIT: Just out of interest, why are you trying to use dynamic typing for your sequence in the first place? I suspect you will find all things like this getting harder ... LINQ is highly dependent on various bits of type of output.
Note that having an IQueryable<dynamic> or IEnumerable<dynamic> is fine and will work better.
source share