TreeView. Please, could someone help me out? RRS feed

  • Question

  • User1608082067 posted


    I created a simple TreeView at runtime:

    Dim tvNavigation as New TreeView
    tvNavigation.CssClass = "Navigation"
    tvNavigation.ID = "Navigation"
    Dim tnClassification As New TreeNode
    tnClassification.SelectAction = TreeNodeSelectAction.Expand
    tnClassification.Text = "Classification"
    Dim tnCategories As New TreeNode
    With tnCategories
      .ImageUrl = "~/App_Assets/Arrow_Icon.gif"
      .SelectAction = TreeNodeSelectAction.Select
      .Text = "Categories"
      .Value = "Categories"
    End With
    Dim tnTags As New TreeNode
    With tnTags
       .ImageUrl = "~/App_Assets/Arrow_Icon.gif"
       .SelectAction = TreeNodeSelectAction.Select
       .Text = "Tags"
       .Value = "Tags"
    End With

    I am having problems in making it look and work the same way as when not using the CSS Adapters.

    Could someone, please, help me out with this?



    Thursday, November 8, 2007 11:55 AM

All replies

  • User2004054815 posted

     Hi Miguel,

    Please tell me what the problem is because that's not clear to me!


    Kind regards,

    Friday, November 9, 2007 7:25 AM
  • User-1015649212 posted

    When you use the CSS Adapters, the treeview will look differently because you must also add CSS styles.  The CSS Adapters do not inject inline styles like this

    < td style="width:400px; font-family:arial; color:green">

    they add CSS "hooks" that you can use in your CSS file to style elements of the table.  Hooks would be extra classes and IDs in the xhtml that allow CSS styling, such as

    <li class="AspNet-Menu-Leaf">

    This list element can be styled in the CSS file in this manner...

    li.AspNet-Menu-Leaf { font-weight: bold; background-color: yellow; }


    Friday, December 14, 2007 4:27 PM