Can the DataSource object implement IHierarchicalDataSource?

Posts   
 
    
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 24-Jun-2006 21:29:07   

I am using Telerik RadTreeview and tried to use the data source object. It gave me the following error:

The DataSourceID of 'CategoryTreeView' must be the ID of a control of type IHierarchicalDataSource. 'CategoryData' is not an IHierarchicalDataSource.

CategoryTreeView - ReadTreeview Control CategoryData - LLBLGenProDataSource2 Control

-Seth

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 25-Jun-2006 10:56:36   

The IHierarchicalDataSource interface shows the sillyness of ASP.NET's databinding model. It should be the data which should tell if the data is hierarchical, and even so, the control should just find out and if it is, use it.

The IHierarchicalDataSource interface defines a method called GetHierarchicalView. That method returns a class, not an interface. This is unfortunate, as I can't re-use the code in the View class I've written because what's returned is a .NET class.

So even if I wanted (these datasource thingies are really a pain to create due to lack of docs and design errors from MS' part) I can't, and have to re-implement everything. So no, they can't.

Frans Bouma | Lead developer LLBLGen Pro
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 29-Jun-2006 22:00:49   

Thank you for the response! I will auto-bind it myself. I agree that implementing one silly thing while throwing everything else out is a waste of time.

-Seth