pprasadravi
asked on
TreeView - State across my website
Hi ,
I am planning to use TreeView control for the below requirements with MasterPage. Could you please guide me to resolve this?
Below is my Sample XML which i get from data base and Sample Treeview code.
1. Display the XML structure in tree structure.
2. Expand the Selected Node and its next level nodes and collapase all other.
3. User has the ability to add new node. We get the XML structue from database when user create/delete the node(Course, Group, Unit and Lesson).
Create : Highlight the new Node when user create new node
XML Strucutre :
<Course CourseID="45" NavigateURL="~/CourseDetai ls.aspx?Mo de=Edit&am p;CourseID =45" CourseName="Asp.Net">
<Group GroupName="Asp Session" GroupID="69" NavigateURL="~/GroupDetail s.aspx?Mod e=Edit& ;GroupID=6 9">
<Unit UnitName="Introduction To ASP Session" UnitID="74" NavigateURL="~/UnitDetails .aspx?Mode =Edit& UnitID=74" >
<Lesson LessonName="Introduction to Inptoc Session" LessonID="191" NavigateURL="~/LessonDetai ls.aspx?Mo de=Edit&am p;LessonID =191" />
</Unit>
</Group>
<Group GroupName="Data Controls" GroupID="68" NavigateURL="~/GroupDetail s.aspx?Mod e=Edit& ;GroupID=6 8">
<Unit UnitName="Introduction to Data Controls" UnitID="73" NavigateURL="~/UnitDetails .aspx?Mode =Edit& UnitID=73" >
<Lesson LessonName="Introduction To Grid View" LessonID="189" NavigateURL="~/LessonDetai ls.aspx?Mo de=Edit&am p;LessonID =189" />
<Lesson LessonName="Introduction to List View" LessonID="190" NavigateURL="~/LessonDetai ls.aspx?Mo de=Edit&am p;LessonID =190" />
</Unit>
</Group>
</Course>
HTML:
<asp:TreeView ID="tvSiteMenu" runat="server" DataSourceID="xdsMenuData"
AutoGenerateDataBindings=" False" OnSelectedNodeChanged="Sel ect_Change " PathSeparator=":" >
<HoverNodeStyle BackColor="#66FFFF" />
<SelectedNodeStyle BackColor="#66FF33" />
<DataBindings>
<asp:TreeNodeBinding DataMember="Course" NavigateUrlField=""
TextField="CourseName" ValueField="NavigateURL" />
<asp:TreeNodeBinding DataMember="Group" NavigateUrlField=""
TextField="GroupName" ValueField="NavigateURL" />
<asp:TreeNodeBinding DataMember="Unit" NavigateUrlField=""
TextField="UnitName" ValueField="NavigateURL" />
<asp:TreeNodeBinding DataMember="Lesson" NavigateUrlField=""
TextField="LessonName" ValueField="NavigateURL" />
</DataBindings>
<RootNodeStyle BackColor="#FF6600" />
</asp:TreeView>
<asp:XmlDataSource ID="xdsMenuData" runat="server"
></asp:XmlDataSource>
Thanks in Advance
Ravi Potturi
I am planning to use TreeView control for the below requirements with MasterPage. Could you please guide me to resolve this?
Below is my Sample XML which i get from data base and Sample Treeview code.
1. Display the XML structure in tree structure.
2. Expand the Selected Node and its next level nodes and collapase all other.
3. User has the ability to add new node. We get the XML structue from database when user create/delete the node(Course, Group, Unit and Lesson).
Create : Highlight the new Node when user create new node
XML Strucutre :
<Course CourseID="45" NavigateURL="~/CourseDetai
<Group GroupName="Asp Session" GroupID="69" NavigateURL="~/GroupDetail
<Unit UnitName="Introduction To ASP Session" UnitID="74" NavigateURL="~/UnitDetails
<Lesson LessonName="Introduction to Inptoc Session" LessonID="191" NavigateURL="~/LessonDetai
</Unit>
</Group>
<Group GroupName="Data Controls" GroupID="68" NavigateURL="~/GroupDetail
<Unit UnitName="Introduction to Data Controls" UnitID="73" NavigateURL="~/UnitDetails
<Lesson LessonName="Introduction To Grid View" LessonID="189" NavigateURL="~/LessonDetai
<Lesson LessonName="Introduction to List View" LessonID="190" NavigateURL="~/LessonDetai
</Unit>
</Group>
</Course>
HTML:
<asp:TreeView ID="tvSiteMenu" runat="server" DataSourceID="xdsMenuData"
AutoGenerateDataBindings="
<HoverNodeStyle BackColor="#66FFFF" />
<SelectedNodeStyle BackColor="#66FF33" />
<DataBindings>
<asp:TreeNodeBinding DataMember="Course" NavigateUrlField=""
TextField="CourseName" ValueField="NavigateURL" />
<asp:TreeNodeBinding DataMember="Group" NavigateUrlField=""
TextField="GroupName" ValueField="NavigateURL" />
<asp:TreeNodeBinding DataMember="Unit" NavigateUrlField=""
TextField="UnitName" ValueField="NavigateURL" />
<asp:TreeNodeBinding DataMember="Lesson" NavigateUrlField=""
TextField="LessonName" ValueField="NavigateURL" />
</DataBindings>
<RootNodeStyle BackColor="#FF6600" />
</asp:TreeView>
<asp:XmlDataSource ID="xdsMenuData" runat="server"
></asp:XmlDataSource>
Thanks in Advance
Ravi Potturi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.