“Imagination is more important than knowledge. For while knowledge defines all we currently know and understand, imagination points to all we might yet discover and create.” - Albert Einstein


Data Bind CoolGridView to IQueryable<>

I recently received a question about how to data bind CoolGridView to an object of type IQueryable<> with automatic sorting and paging. CoolGridView extends ASP.NET GridView control. GridView does not directly support DataSource of type IQueryable<>, and the same is true for CoolGridView. We can use LinqDataSource control to bridge the gap. Quickly bind CoolGridView control to IQueryable<> with automatic sorting and paging capability by following these easy steps.

  1. Drop a CoolGridView and a LinqDataSource control into your ASPX page.
  2. In the "Properties" toolbox, set the DataSourceID of CoolGridView to point to your LinqDataSource control. Set the properties of CoolGridView control to the following:
    • AllowPaging : True
    • AllowSorting : True
  3. Handle the "Selecting" event of LinqDataSource
  4. In the "Selecting" event handler, call your method that returns an IQueryable<> object and assign it to the event argument's property "e.Result".
There you have it!

Have a great weekend everyone.

Labels: , , , , ,

 Subscribe to feed

2 Responses to “Data Bind CoolGridView to IQueryable<>”

  1. # Anonymous Anonymous

    Need some clarification about Collgridview.

    Hi I have found a thing while I have been integrating your dll with my current project. When I run my project I can find out the dll tries to write some information on the website "dwww_objectify_ca.d.chango.com..", that making my web page to slow. How can I remove this from your dll?  

  2. # Blogger John Eric Sobrepena

    CoolGridView has no component that connects to the internet on it's own so I am not even sure what that website is.
    I suggest you download the source code of CoolGridView, compile and include it in your project.  

Post a Comment



Links to this post

Create a Link

John Eric Sobrepena

John Eric Sobrepena
Hi, I am an I.T. professional who loves technology. I am right now into Android development. I am also a subject matter expert on C#, ASP.NET, WPF and Silverlight. Photography is one of my many hobbies.
Bookmark and Share

Type your Email

Follow me on Twitter.

Flickr Photostream



 Subscribe to feed


Powered by Blogger



© 2006 IdeaSparx | Blogger Templates by GeckoandFly.
No part of the content or the blog may be reproduced without prior written permission.