Hi, I use Asp.net, SQL 2008 and EF 4.
I need display hierarchy data in a treeview control, Data is stored in a DB that use HierarchyId.
Unfortunately, EF4 doesn't support HierarchyId.
So in this case, I thought to have a stored procedure that deals with my hierarchy and return a result set back to EF that EF4 can turn into a collection of user-defined complex type that can then be bound directly to the treeview control.
I imported a SPROC in EF 4 using Import Function and now I have a Complex DataType called:
CategoryHierarchy_Result
An image of my Model:
Here some data from the Complex Type (in a GridView for example GridView1.DataSource = context.CategoryHierarchy(1);):
My questions is:
How to display my data from my Complex Type in a TreeView Control, showing a Tree structure that respect CategoryNodeString?
I am a beginner an I never use TreeView before, any help or resource would be appreciated! Thanks!.
Here some useful resource:
http://www.robbagby.com/entity-framework/entity-framework-modeling-action-stored-procedures/