如题

解决方案 »

  1.   

    Item_Created事件 
    if(e.Item.ItemType==ListItemType.Item||还有那个交替项)
    e.Item.Attributes.Add("onmouseover","javascript:this.bgcolor='red'");
    e.Item.Attributes.Add("onmouselevel","javascript:this.bgcolor='原来的颜色'");
    可以试试看
      

  2.   

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        createtree()
    End SubPrivate Sub createtree()
        Dim tnd As New TreeNode
        Dim tndChild As New TreeNode    tnd.Text = "root"
        tnd.DefaultStyle.CssText = "color:#ffffff;background-color:#cc0000;"
        tnd.HoverStyle.CssText = "color:#ffffff;background-color:#cc0000;"
        tnd.SelectedStyle.CssText = "color:#ffffff;background-color:#000000;"    tndChild.Text = "Child"
        tndChild.DefaultStyle.CssText = "color:#ffffff;background-color:#0000ff;"
        tndChild.HoverStyle.CssText = "color:#ffffff;background-color:#0000ff;"
        tndChild.SelectedStyle.CssText = "color:#ffffff;background-color:#000000;"    tnd.Nodes.Add(tndChild)
        TreeView1.Nodes.Add(tnd)    TreeView1.ExpandLevel = 5    PlaceHolder1.Controls.Add(New LiteralControl("<div style='background-color:#ffcc99'>"))
        PlaceHolder1.Controls.Add(TreeView1)
        PlaceHolder1.Controls.Add(New LiteralControl("</div>"))End Sub
      

  3.   

    .aspx<form id="Form1" method="post" runat="server">
    <iewc:TreeView id="TreeView1" runat="server"></iewc:TreeView>
    <asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder>
    </form>
      

  4.   

    if(!ispostback)
    {
          TreeCtrl.Attributes.Add("onmouseover", "this.className='MouseOver'");
          TreeCtrl.Attributes.Add("onmouseout", "this.className='MouseOut'");
    }
      

  5.   

    <HoverNodeStyle BorderStyle="none" BackColor="red" ForeColor="#000000" Height="25px"/>