日期:2014-05-19  浏览次数:20408 次

用户动态添加、删除树视图问题!
要做成用户可以添加、删除下列数据分类,如果实现?请给个例子或思路,万分感谢!!!

金属切削机床  
...车床    
......台式及仪表车床    
......立式车床    
......卧式车床    
......仿形车床    
......数控车床    
......其他    
...钻床    
......台式钻床    
......摇臂钻床    
......立式钻床    
......数控钻床    
......其他    
...镗床    
......卧式镗床    
......立式镗床    
......坐标镗床    
......数控镗床    
......其他  


------解决方案--------------------
TreeView+Sql+C#
------解决方案--------------------
TreeView+fomView+GridView
------解决方案--------------------
我这里才做了类似的工作
你可以参考下:
<%@ Register TagPrefix= "componentart " Namespace= "ComponentArt.Web.UI " Assembly= "ComponentArt.Web.UI " %>
<%@ Page language= "c# " Codebehind= "RegisterProcess.aspx.cs " AutoEventWireup= "false " Inherits= "MBO.DeveloperManage.RegisterProcess " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> RegisterProcess </title>
<meta content= "Microsoft Visual Studio .NET 7.1 " name= "GENERATOR ">
<meta content= "C# " name= "CODE_LANGUAGE ">
<meta content= "JavaScript " name= "vs_defaultClientScript ">
<meta content= "http://schemas.microsoft.com/intellisense/ie5 " name= "vs_targetSchema ">
<LINK href= "/MBO/Css/treeStyle.css " type= "text/css " rel= "stylesheet ">
<meta http-equiv= "Pragma " content= "no-cache ">
<meta http-equiv= "Cache-Control " content= "no-cache ">
<meta http-equiv= "Expires " content= "0 ">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id= "Form1 " method= "post " runat= "server ">
<FONT face= "宋体 ">
<asp:button id= "Button2 " style= "Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 24px " runat= "server "
Text= "添加根结点 "> </asp:button> <asp:button id= "Button3 " style= "Z-INDEX: 102; LEFT: 152px; POSITION: absolute; TOP: 24px " runat= "server "
Text= "添加子结点 "> </asp:button> <asp:button id= "Button4 " style= "Z-INDEX: 103; LEFT: 272px; POSITION: absolute; TOP: 24px " runat= "server "
Text= "删除结点 " CausesValidation= "False "> </asp:button> <COMPONENTART:TREEVIEW id= "TreeView1 " style= "Z-INDEX: 104; LEFT: 24px; POSITION: absolute; TOP: 64px " runat= "server "
Templates= "(Collection) " LineImagesFolderUrl= "/MBO/Image/images/lines/ " ShowLines= "True " NodeLabelPadding= "3 " DefaultImageHeight= "16 " DefaultImageWidth= "16 "
LineImageHeight= "20 " LineImageWidth= "19 " NodeEditCssClass= "NodeEdit " HoverNodeCssClass= "HoverTreeNode " SelectedNodeCssClass= "SelectedTreeNode " NodeCssClass= "TreeNode "
CssClass= "TreeView " Width= "220px " Height= "100% " KeyboardEnabled= "False " ImagesBaseUrl= "/MBO/Image/images/ " DragAndDropEnabled= "True " ExpandSelectedPath= "False "