User59752322 posted
I've got this working very nicely and customized the code to do exactly what I want (output in ' li ') so that I got down no sweat.
what I would like to do is make "EnableAdapter" a property for treeview. The project calls for this (admin side = "don't care" and public face = "as compliant as humanly possible") and I first tried something like this...don't laugh, I'm new at this
custom control thing
1 Public Class AdaptedTreeView
2 Inherits TreeView
3
4 Private _enableAdapter As New Boolean
5
6 Public Property EnableAdapter()
7 Get
8 Return _enableAdapter
9
10 End Get
11 Set(ByVal value)
12 _enableAdapter = value
13 End Set
14 End Property
15
16 Private Function IsEnabledAdapter() As Boolean
17 Return _enableAdapter
18 End Function
19
20 End Class
Seems simple enough, and I go to sneak in a little present into the Override OnLoad in the TreeViewAdapter.cs like this (well, it didn't work, but I was hoping)
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
MyBase.OnLoad(e)
Dim treeView As AdaptedTreeView = CType(Control, AdaptedTreeView)
If (treeView.EnableAdapter) Then
I went into the .designer.vb trying to be sneaky and changed the type out, but no luck, comes up with
Parser Error Message: The base class includes the field 'TreeView1', but its type (CMS.Web.UI.CSSFriendly.AdaptedTreeView) is not compatible with the type of control (System.Web.UI.WebControls.TreeView).
I got my property but I'm not sure how exactly ...wait, let me guess, compile a dll and add that as a control to my toolbox and drag/drop? Or I guess I could drop a panel or placeholder on the page and do a controls.add?
and further, anyone have a better idea/method/idea on how to do this?