请问如何在用户点击的时候将IEWC:TREEVIEW的节点替换成一个TEXTBOX?

netxray 2004-11-03 09:00:13
似乎treenode没有innerhtml?
...全文
199 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
netxray 2004-11-09
  • 打赏
  • 举报
回复
http://www.componentart.com/demos/treeview/features/core_features/default.aspx
大家看看这个双击节点就可以修改的tree是怎么实现的?
wenjunqianli 2004-11-08
  • 打赏
  • 举报
回复
关注。我也想像楼主那样做。可是没办法实现。
lonelydreamsym 2004-11-08
  • 打赏
  • 举报
回复
up
chengsion 2004-11-08
  • 打赏
  • 举报
回复
TreeView Events
Events arising from user interaction can be directed to the server by setting the AutoPostBack property to true. Server-side script should be used when handling events for both uplevel and downlevel browsers because the rich DHTML behaviors used in the Internet Explorer 5.5 or later versions are not used in the downlevel page content.

For a Web page that has a TreeView, the main interaction by the user is to expand and collapse the nodes in the tree to explore the content. The following sample code shows how the onexpand, oncollapse, and onselectedindexchange events can be handled in a Web Form using C#.

<script language="C#" runat="server">
void myExpandFn(object sender, TreeViewClickEventArgs e)
{
mylabel.InnerText += "Expanded (Node Index= " + e.Node.ToString() + ")";
}

void myCollapseFn(object sender, TreeViewClickEventArgs e)
{
mylabel.InnerText += "Collapsed (Node Index = " + e.Node.ToString() + ")";
}

void mySelectChangeFn(Object sender, TreeViewSelectEventArgs e)
{
mylabel.InnerText += "Selected " + e.NewNode.ToString() + " (old Node
Index=" + e.OldNode.ToString()+")" ;
}
</script>
netxray 2004-11-08
  • 打赏
  • 举报
回复
自己顶一下
netxray 2004-11-03
  • 打赏
  • 举报
回复
楼上的我试了一下,似乎得不到点击节点的宽度和高度,这样的话会遮不住节点
reddg 2004-11-03
  • 打赏
  • 举报
回复
不如使用一个隐藏的div,中间签着textbox 和一个保存按钮、一取消按钮,双击节点的时候,div显示在节点的位置,遮住节点,保存后修改节点的值,同时div隐藏
netxray 2004-11-03
  • 打赏
  • 举报
回复
上面说错了,是双击节点的时候,节点变成文本框
netxray 2004-11-03
  • 打赏
  • 举报
回复
用户的需求是在单击节点时,节点变成一个文本框,修改完毕后文本框又恢复成原来节点的样子,但节点的标题被更新了,显然这只能用javascript完成。
至于修改顶楼说“修改Treeview.htc”,能不能给点提示?谢谢!
listhome 2004-11-03
  • 打赏
  • 举报
回复
关注
xzq686 2004-11-03
  • 打赏
  • 举报
回复
gz
xiaohutushen 2004-11-03
  • 打赏
  • 举报
回复
帮忙UP
goody9807 2004-11-03
  • 打赏
  • 举报
回复
2)修改节点
2.1 节点属性的树型修改
Dim tmpNd3 As New Microsoft.Web.UI.WebControls.TreeNode()
''tmpNd3 为当前选定的节点
tmpNd3 = Treepaybasic.GetNodeFromIndex(Treepaybasic.SelectedNodeIndex)
tmpNd3.Text = "aaa"
2.2 数据库中的节点属性修改操作
''定义修改命令的属性
Dim updatecomm = New System.Data.OleDb.OleDbCommand()
''定义修改命令的各种属性
updatecomm.CommandText = "update treebasic set name=''" & nodetext & "'' ,remark=''" & remark & "'' ,links=''" & purl & "'' where payid=" & CInt(pid) & ""
updatecomm.Connection = MyConn
''打开连接、执行命令
MyConn.Open()
updatecomm.ExecuteNonQuery()
MyConn.Close()
在为大家提供几个树的常用方法:
(1)节点的展开
''用于已经知道要展开节点index值的时候
Dim tmpNd As Microsoft.Web.UI.WebControls.TreeNode
tmpNd = New Microsoft.Web.UI.WebControls.TreeNode()
tmpNd = Treepaybasic.GetNodeFromIndex(Treepaybasic.SelectedNodeIndex)
tmpNd.Expanded = True
(2) 判断节点在第几层
''点击treeview控件某个节点时, 判断该节点位于哪一层
''判断index中"."的个数即可知道节点在那层。
Dim NdSel As New Microsoft.Web.UI.WebControls.TreeNode()
''''NdSel 为当前选定的节点
NdSel = Treepaybasic.GetNodeFromIndex(Treepaybasic.SelectedNodeIndex)
Dim index As String = NdSel.GetNodeIndex()
dim level as Integer = index.Length - index.Replace(".", "").Length + 1
孟子E章 2004-11-03
  • 打赏
  • 举报
回复
你可以修改Treeview.htc自己实现,主要的转换都在这个文件里

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧