Last post Sep 28, 2020 07:39 PM by KathyW
Sep 23, 2020 04:10 PM|inkaln|LINK
I'm used to working with treeview but not sure if I can accomplish what I need...I'm actually trying to create a dynamic treeview structrue but using <ul> <li> nested tags....the <li> tag will have a few attributes added based on the node (whether it's a
folder or an actual file...)...example is below:
<li data-active="false" data-id="2" data-type="pdf" data-path="https://some.path.com/filename.doc" style=""><i class="fileicon fas fa-file-pdf"></i><span>FileReport.pdf</span></li>
Is there an asp.net control besides treeview that has the <ul> <li> elements? I can use repeater I believe but how do I make it dynamic? Parent REpetear control would have the top <ul> tab but then each <li> could have nested <ul> which could have nested
tags etc.... there is no limit to how deep the structure can be so it needs to be fully dyanmic.
Sep 23, 2020 08:23 PM|mgebhard|LINK
The DataList or ListView can create a unordered list <ul>.
A Repeater will also work.
Sep 28, 2020 03:03 PM|inkaln|LINK
These controls don't have events for nodes...like the treeview structure does....is there not a way to make treeview control render with <ul> <li> tags instead of table structure?
Sep 28, 2020 07:39 PM|KathyW|LINK
I don't think there is. There used to be "CSS friendly control adapters" to change how some Webforms controls were rendered, but that wasn't kept up to date (2006, 2007), and I don't think you can even find a link to it anymore, or if they would work, if
Is there any reason you can't use a TreeView for what you want, even though it renders as table elements? You can modify its styling using CSS for the elements it does render, and add CSS attributes in code behind to specific nodes if they meet some criteria.