My treeview Data is Not changing.
- by Vibin Jith
Hai ,
I am trying to display the user permission in a treeview.For each user permissions are stored in the database as xml file. In the page, a Combo box used to list the users and a treeView used to bind the Permission xml. When the user get selected in the combo box , i took the xml from the database and connect with xmlDatasource and bind with the treeView. What happening is , First time the TreeView fill with the xml nodes and another time it will not work. For the first selection it's ok. Anothers selections are not effected by the treeview. The code is debugging. No problem.
Can you just tell ,why the treeview datasource is not updating.
I used this code ..
Dim permissionRoot = From permissionNode In MyUser.UserPermissionXml.Root.Elements("menuNode")
XmlTreeViewSource.Data = permissionRoot(0).ToString
trvPermission.DataSource = XmlTreeViewSource
trvPermission.DataBind()
SetPermission(trvPermission.Nodes(0))
The markups
<asp:TreeView ID="trvPermission" runat="server" ExpandDepth="2"
ShowCheckBoxes="All" ShowLines="True" ForeColor="#005782" >
<DataBindings>
<asp:TreeNodeBinding DataMember="menuNode" TextField="title"
ValueField="value" />
</DataBindings>
</asp:TreeView>