Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Net树视图截断节点文本_Asp.net_Vb.net_Treeview - Fatal编程技术网

Asp.net Net树视图截断节点文本

Asp.net Net树视图截断节点文本,asp.net,vb.net,treeview,Asp.net,Vb.net,Treeview,我在我的ASP.Net页面上有一个树状视图,由于某些原因,某些节点上的文本被截断,我正在通过编程添加所有节点,并注意到此处列出的现有问题:但是我没有更改字体,正如您在下面的代码中看到的,此修复对我不起作用 Private Sub populateTreeView() 'Code that gets the data is here Dim ParentIds As List(Of Integer) = New List(Of Integer) For Each r

我在我的ASP.Net页面上有一个树状视图,由于某些原因,某些节点上的文本被截断,我正在通过编程添加所有节点,并注意到此处列出的现有问题:但是我没有更改字体,正如您在下面的代码中看到的,此修复对我不起作用

 Private Sub populateTreeView()

'Code that gets the data is here

      Dim ParentIds As List(Of Integer) = New List(Of Integer)

      For Each row As DataRow In ds.Rows

         If ParentIds.Contains(row("ParentID")) Then
            '' Do Nothing 
         Else
            ParentIds.Add(row("ParentID"))
         End If
      Next

      For Each Parent As Integer In ParentIds
         Dim parentNode As New System.Web.UI.WebControls.TreeNode

         For Each child In ds.Rows
            If (child("ParentID") = Parent) Then

               Dim childNode As New System.Web.UI.WebControls.TreeNode

               parentNode.Text = child("ParentDescription")
               parentNode.Value = child("ParentID")
               parentNode.Expanded = False

               childNode.Text = child("ChildDescription")
               childNode.Value = child("ChildID")


               parentNode.SelectAction = TreeNodeSelectAction.None
               parentNode.ChildNodes.Add(childNode)
            End If
         Next
         trvItem.Nodes.Add(parentNode)
      Next

      'This is just added to test the MS fix
      trvItem.Nodes(0).Text += String.Empty
   End Sub
奇怪的是,这个问题只出现在IE中,我在chrome和Firefox中进行了测试,两种浏览器都完美地显示了文本

当我选择一个节点时,这解决了问题,所有文本显示正常

任何关于这里出了什么问题的想法都会很好,因为我现在一无所知


谢谢

将此标记为关闭,因为我从未收到解决问题的答案


我设法解决了这个问题,使用javascript回发来选择加载的一个项目,从而强制正确显示文本。我认为这是我在原始问题中链接的bug的扩展。

听起来像是IE特有的CSS问题。如果你在这个页面上发布一个URL,我相信你会找到一个精通CSS的人来诊断这个问题。@JustinGrant遗憾的是,我不能把它作为一个公司内联网页面。我会看看CSS,但我很确定没有任何直接应用到Treeview本身
tv1.LabelEdit = True

tv1.Nodes(0).Nodes(0).BeginEdit()

tv1.Nodes(0).Nodes(0).NodeFont = oNewFont

tv1.Nodes(0).Nodes(0).EndEdit(False)

tv1.LabelEdit = False