I’ve just finished a web project that I used the Essential Objects TreeView control.
I had thought initially that it would be relatively easy to configure. I’ve used a number of Essential Objects controls before and always found them fairly intuitive to use.
However, the TreeView was anything but intuitive. At the designer level it looks pretty straightforward. Just like the Tabstrip I thought. And initially all seemed well. But I had a real problem making sense of the data binding. Of course, its data driven so that would be a problem.
I thought I’d got it sorted out fairly early on, and then I realized that the data binding of each node was not what I expected.
The programming examples for the Treeview are, unfortunately non-existent on the essential objects website. Instead, they refer you to the menu control examples. This was pretty frustrating, as I was on a tight deadline and just wanted a Treeview example, nice and straight forward like. Please feel free to post this if you want.
So, this is how I bound the Treeview and got the correct itemID’s established.
Private Sub tvCookClass_ItemDataBound(ByVal sender As Object, ByVal e As EO.Web.NavigationItemEventArgs) Handles tvCookClass.ItemDataBoundTry
‘set the itemid based on the dataset array index
e.NavigationItem.ItemID = CType(e.NavigationItem.DataItem, DataRow).ItemArray(0).ToString
If e.NavigationItem.Level.Equals(1) Then
‘this is the student level data
‘position 4 is the class data for each payment
e.NavigationItem.Value = CType(e.NavigationItem.DataItem, DataRow).ItemArray(4).ToString
Catch ex As Exception
One really neat feature is the customItem control. This allowed me to quite easily embed an editor feature inside the Treeview. This was a relief after the problems I had binding the thing in the first place.
So eventually I got a pretty neat solution using this control. It will require some work to get the thing looking a little better. I might even look at changing the editor so it goes below the selected node, rather than right next to / over it. But itâ€™s nice to be able to update or edit the data with a couple of mouse clicks, without posting to a different form.
I would definitely use it for other projects. I didn’t have time to put it into an AJAX wrapper but next update I’ll try that too.