Home - Forums-.NET - FlyTreeView (ASP.NET) - IHierarchicalDataSource

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

IHierarchicalDataSource
Link Posted: 27-May-2008 06:02
Hi.

I built a helper class that will convert tabular data to hierarchical data, much like the helper method that you have defined. The class that I built extends HierarchicalDataSourceControl (which in turn implements IHierarchcialDataSource).

Let's say I define a DataTable with 3 columns, (ID, ParentID and Text)

Now, when I run the code:

        HDTDataSourceControl dsc = new HDTDataSourceControl(table, "ParentID", "ID");
        FlyTreeView1.DataSource = dsc;
        FlyTreeView1.DataBind();


where HDTDataSourceControl is my class (and I have added a data binding for the text column), the tree view does not render the Text column properly.

Instead of rendering the Text column from the DataTable the TreeView renders (at least it appears to render) the type returned by a call to IHierarchyData.

I know this is hard to explain. I can send you the code if you like.

Thoughts?

Dave
Link Posted: 27-May-2008 09:16
Do you have Text property (attribute) in your data item? If not, then you should add proper nodebinding (that will bind other property of your dataitem to Text), otherwise treeview uses dataItem.ToString() to get its Text property, so you can also override ToString() method of your data item in order to make it return what you need in Text.
Link Posted: 27-May-2008 09:37
Hi.

I do have a Text property in the data item. The Microsoft TreeView component renders it properly but your tree is much better in every other respect  

Should I send the code?
Link Posted: 27-May-2008 10:50
Better, a simple test case that we can run and debug.
Link Posted: 28-May-2008 11:41
Ok, here's a project. It's got a couple of extraneous files in it which you can ignore. It's just a testing project for me.
Link Posted: 29-May-2008 23:10
Finally, we fixed this.
Now FlyTreeView should work correctly with custom datasources.
The reason why I didn't before is because it required custom hierarchical datasource to implement ICustomTypeDescriptor (like built-in datasources of .NET and custom one created by ConvertTabularDataToHierarchical method).

Fixed version will be available for download tomorrow.
Link Posted: 29-May-2008 23:19
BTW
Dave, thanks for your help!
Link Posted: 08-Jun-2008 12:39
Interesting.

You've removed the posts that were critical of your support. That's pretty weak.
Link Posted: 08-Jun-2008 22:00
No, just split the topic (viewtopic.php?f=13&t=1987)