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.
Have a great weekend everyone.
- Drop a CoolGridView and a LinqDataSource control into your ASPX page.
- 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
- Handle the "Selecting" event of LinqDataSource
- In the "Selecting" event handler, call your method that returns an IQueryable<> object and assign it to the event argument's property "e.Result".
Have a great weekend everyone.
Labels: ASP.NET, CoolGridView, Data Binding, GridView, IQueryable, LinqDataSource
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?
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.