We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

get id node

Hi,

First, sorry in advance for my english, i'm French and my english is maybe incorrect.

I'm a new user and i have two problems with the TreeView.

My project is in ASP.NET (VB).

1. My TreeView is linked with a database by a SqlDataSourceControl. Why the TreeView is cleared at each PostBack?
I use this method for ListView control (framework Windows) and i don't have this problem.
And if set "EnabledPersistence" at True, data are incorrect!! it's very strange.

2. I have checkboxes in my TreeView. How get the ID list of nodes which are checked??

Regards,

Cyril MAINAUD

1 Reply

MS Muralishankar Sundaram Syncfusion Team January 8, 2015 05:58 PM UTC

Hi Cyril,

Thanks for using Syncfusion controls.

Query 1 -“My TreeView is linked with a database by a SqlDataSourceControl. Why the TreeView is cleared at each PostBack? And if set "EnabledPersistence" at True, data are incorrect!! it's very strange,”

We unable to reproduce the reported issue, so please share the issue reproducing sample or modify the attached sample and share the same with us with detailed steps with us.

Query 2 -“ I have checkboxes in my TreeView. How get the ID list of nodes which are checked??”

Yes, we can get the selected items text while check the node in ‘OnNodeChecked’ server side events. Please refer the below code snippet:

<code>

[ASPX.CS]

Protected Sub sampleTreeview_NodeChecked(sender As Object, e As Syncfusion.JavaScript.Web.TreeViewEventArgs)

        Dim CheckedNodes As ArrayList = TryCast(e.Arguments("currentCheckedNodes"), ArrayList)

        lblChecked.Text = "checked Node List =>"

        For Each sample As String In CheckedNodes

            lblChecked.Text = lblChecked.Text + sample & Convert.ToString("--")

        Next

    End Sub

</code>

Unfortunately we unable to get the id in ‘onNodeChecked’ event, in case if you want to collect the id of checked nodes, please report it as feature using Direct Track account.

We prepared the sample solution with reported scenario and attached in a bellow link:

http://www.syncfusion.com/downloads/support/directtrac/117902/TreeviewSample646934545.zip

Please let me know if you have any concerns.

Regards,

Muralishankar S.



Loader.
Live Chat Icon For mobile
Up arrow icon