2010-11-30 16 views
0

displayはひどいです。行間にはいくつかのスペースがあります。ASPの垂直スペーシングの設定方法.Net treeview with checkbox

私はウェブページでasp:treeviewを使用しています。外観はskin.The TreeViewSkinで構成されてApp_Themesの下で利用可能SkinFile.skinに書き込まれます。データバインディングはBuildTreeview方法によって行われた情報については

<asp:TreeView SkinID="TreeViewSkin" runat="server" ShowLines="true" ShowCheckBoxes="All" Style="margin-top:10px;"> 
    <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /> 
    <NodeStyle Font-Names="Verdana" Font-Size="8pt" HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /> 
    <ParentNodeStyle Font-Bold="False" /> 
    <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" VerticalPadding="0px" /> 
</asp:TreeView> 

:私はコードの所有者ではないよ

public static void BuildTreeView<T>(this IEnumerable<HierarchyNode<T>> hierarchy, TreeView treeView, string idName, string libName) where T : class 
{ 
    TreeNode treeNode = null; 
    var treeview = typeof(T); 
    foreach (var obj in hierarchy) 
    { 
     var nameProperty = obj.GetType().GetProperty("Entity"); 
     if (nameProperty == null) continue; 
     var value = (T)nameProperty.GetValue(obj, null); 
     var property = treeview.GetProperty(idName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance); 
     var curElementIdValue = Convert.ToInt32(property.GetValue(value, null)); 

     var labelProperty = treeview.GetProperty(libName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance); 
     var labelValue = (string)labelProperty.GetValue(value, null); 

     if (value != null) treeNode = new TreeNode() {Text = labelValue, Value = curElementIdValue.ToString()}; 

     var childNodes = obj.GetType().GetProperty("ChildNodes"); 
     if (childNodes != null) { 
      var propValue = childNodes.GetValue(obj, null); 
      BuildTreeNode<T>(propValue as IEnumerable, treeNode, idName, libName); 
     } 
     if (treeNode != null) treeView.Nodes.Add(treeNode); 
    } 
} 

。私はこのメソッドのコードがやや曖昧だと認めます... チェックボックスを表示するのは間違っていますか?このsampleではChromeで部分的に再現できますが、IE7では再生できません。 Iがっかり;)

答えて

0

私はblogs.msdn.com

The {DIV} tag generated height is only 1px instead of 20px. 
に回避策を見つけました
関連する問題