代码之家  ›  专栏  ›  技术社区  ›  Jonathan Sternberg

在Web控件中加粗TreeNode文本

  •  0
  • Jonathan Sternberg  · 技术社区  · 14 年前

    但是我需要能够在Javascript中将节点设置为导航模式而不是选择模式。我试着通过回调来实现。javascript使用树节点的ValuePath向服务器发送回调。然后我试着这样做:

    TreeView treeView = GetCurrentTreeView(); // Gets the current displayed tree view
    TreeNode node = treeView.FindNode(argument); // This returns the correct node
    node.Text = "<b>" + node.Text + "</b>"; // This shows up as changing in the debugger
    // It does not stay changed
    

    但加粗的文字似乎只是被忽视。它不会显示在页面上,如果我再次单击,则粗体字将在调试器中消失。

    发生什么事?有什么办法吗?

    无法将TreeNode更改为使用选择模式。我需要有C#服务器端代码能够将文本更改为粗体(也就是说,我需要在用户单击网站上完全不相关的部分时更改它)。

    1 回复  |  直到 14 年前
        1
  •  0
  •   Jonathan Sternberg    14 年前

    最后我把它放在一个更新面板中,并将TreeView更改为使用Select模式(因此发生了回发)。

    仅仅使用Navigate和Javascript似乎没有任何方法可以获得想要的效果。