Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Link Webdatatree with a repeater in VB
posted

Hi,

I created a webdatatree that when a user clicks on a child node, it should show me a row of a repeater, where information is contained.

How do I link the datatreenodebinding with itemtempalte of the repeater in vb?

  • 1300
    Offline posted

    Hello Camilla,

    After investigating this further, I determined that your requirement could be achieved by binding a method to the NodeClick event and setting the property “AutoPostBackFlags-NodeClick” to “on”.

    The method WebDataTree1_NodeClick sets the clicked element’s text as a datasource of the repeater:

    Protected Sub WebDataTree1_NodeClick(sender As Object, e As Infragistics.Web.UI.NavigationControls.DataTreeNodeClickEventArgs) Handles WebDataTree1.NodeClick 

            Dim nodeText = e.Node.Text

            Dim ds As DataSet = New DataSet()

            Dim dt As DataTable = New DataTable()

            dt.Columns.Add(New DataColumn("nodeName"))

            Dim row As DataRow = dt.NewRow()

            row("nodeName") = nodeText

            dt.Rows.Add(row)

            ds.Tables.Add(dt)

     

            rep1.DataSource = ds

            rep1.DataBind()

     

        End Sub

    Below I am attaching a sample, demonstrating the described behavior. Please let me know if you need additional information regarding this matter.

    Regards,

    Monika Kirkova,

    Infragistics

    WebDataTreeNodeClick.zip