Thanks Varalakshmi, I have looked at the examples for ASP.net although the example shown is for a manually created node.
I am having trouble making the step between a databound tree and loading the child on demand
I could be completely going down the wrong path, although an example of what I am trying to do, which is take some of your example is below.
ANY help would be greatly appreciated.
Protected Sub TreeView1_NodeExpanded(sender As Object, e As Syncfusion.Web.UI.WebControls.Tools.TreeViewNodeEventArgs) Handles TreeView1.NodeExpanded
e.Node.Items.Add(Me.BuildTree(e.Node.ID))
End Sub
Private Function BuildTree(nClientID As String) As TreeViewNode
Dim dsGroup As New DataSet
dsGroup = ReturnClientTree(sClient)
Dim oTree As TreeView = New TreeView()
oTree.DataSource = dsGroup
oTree.DataMember = dsGroup.Tables(0).TableName
Dim oTv As New TreeViewItemBinding
oTv.DataMember = dsGroup.Tables(0).TableName
oTv.ParentIDField = "PID"
oTv.TextField = "MDESC"
oTv.IDField = "MID"
oTv.Expanded = True
oTree.DataBindings.Add(oTv)
oTree.DataBind()
Return oTree.Items(0) 'ISSUE: this only returns the first node, but the theory works
End Function
Hi Ross,
Thanks for the update.
TreeView node should be returned from the BuildTree event
for this requirement and you have used “oTree.Items(0)” which always returns first
node of the TreeView. Can you please share a simple sample with us to see the
exact issue. It would help us on analyzing your needs.
Regards,
Varalakshmi
Hi Varalakshmi
I have attached an example of what I am trying to do.
It would appear that it order for this to work, I have to add a dummy parent in order to see all the children as I can only return one node.
I have included a couple of screen shots of what it looks like on the live site so you can see what it would look like for the user. Ideally, after selecting the parent, all the children would appear directly under the parent, rather than an extra step down.
While I could manually build this by iterating through the dataset, it is not ideal from a performance point of view.
Hoping there is an easier way.
Regards
Ross
Hi Varalakshmi
You don't need my database for this example as you just need to point a sql instance. The queries used do not actually query any table, so currently the query just points to the master database/
Regards
Ross
We regret for the inconvenience.
Currently we are not providing support for load on demand using database binding and this is already logged as feature requirement. This will be available in our ES volume 3,2012 release which is scheduled in the month of July. We will get back you once this feature is implemented.
Regards,
Varalakshmi