Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
DZone MVB

Links

Social

MoreDefensiveDatasource

At the end of the previous month I wrote a posting on DefensiveDatasource class that can be used to associate ASP.NET's GridView with collections containing objects of different types and based on one and the same base class. Dividing data into pages in GridView does, however, not succeed. An error message "The data source does not support server-side data paging" is displayed.

 

NB! This blog is moved to gunnarpeipman.com

Click here to go to article

Comments

DigiMortal said:

Can you send me your e-mail address? I have binaries of this class in my source code repository.

# June 1, 2008 3:40 AM

DigiMortal said:

Thank you, Aredhel! :)

# February 24, 2009 4:51 AM

Frederic said:

This solution has a drawback : if your grid use template fields, with custom binding relying on manipulating your base class, you will get an invalid cast exception.

The defensivedatasource made your grid bound to an object type which is not derivate from your original base type in your list.

Personally, I have ended up reimplementing a custom hyperlinkfield polymorphism aware. And I used it instead of the vanilla hyperlinkfield.

This suppose to supply custom field for any vanilla field that does not support polymorphism (I do not know a list of such fields).

# December 1, 2010 11:11 AM