当前位置:编程学习 > C#/ASP.NET >>

treeview节点怎么不自动收缩?

在vs2010中,怎么实现选择treeview的一个节点时,不让其他节点已经展开的节点自动收缩起来 --------------------编程问答-------------------- 学习中 --------------------编程问答--------------------
引用 1 楼 ghostsea 的回复:
学习中

共同学习 --------------------编程问答--------------------
引用 2 楼 tyfandkhr 的回复:
引用 1 楼 ghostsea 的回复:
学习中

共同学习


一起学习中 --------------------编程问答-------------------- 没用过10的  和08不一样么? --------------------编程问答-------------------- ...我怎么没出现这种情况... --------------------编程问答-------------------- treeview里面有属性找找看呗! --------------------编程问答-------------------- --------------------编程问答--------------------

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <script src="jquery-1.4.4.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            var treeId = '<%=this.TreeView1.ClientID %>';
            $("#" + treeId + " a").each(function() {
                $(this).removeAttr("href");
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TreeView ID="TreeView1" runat="server" DataSourceID="XmlDataSource1">
        </asp:TreeView>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource>
    </div>
    </form>
    
    <%--下面是XMLFile.xml数据
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
  <book id="No1">
  <title>An Introduction to XML</title>
  <author>Chunbin</author>
  <year>2010</year>
  <price>98.0</price>
  
</book>
  <book id="No2">
  <title>The Performance of DataBase</title>
  <author>John</author>
  <year>1996</year>
  <price>56.0</price>
</book>
</bookstore>--%>
</body>
</html>
--------------------编程问答--------------------
引用 4 楼 hj_daxian 的回复:
没用过10的 和08不一样么?

可能有点不一样,以前只用过05的,只知道10的.net Framework是4.0的了 --------------------编程问答--------------------
引用 6 楼 it0329 的回复:
treeview里面有属性找找看呗!

如果找出来了我就不来提问题了,嘿嘿 --------------------编程问答--------------------
引用 5 楼 windsky87 的回复:
...我怎么没出现这种情况...

可能是你人品比较好吧 --------------------编程问答-------------------- this.treeView1.SelectedNode.Expand(); // 展开子节点

或者 遍历没有被选中的 设置节点收缩. --------------------编程问答-------------------- 到目前为止还没找到答案,值得研究
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,