display太可怕了;线之间有一些空格。
我在网页中使用了asp:treeview
。外观配置了皮肤。TreeViewSkin
写入SkinFile.skin
App_Themes
下的<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>
:
BuildTreeview
有关信息,数据绑定由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);
}
}
方法完成:
{{1}}
我不是代码的所有者;我承认这个方法的代码有点模糊...... 显示复选框是错误的吗?我可以使用此sample部分重现Chrome,但不能在IE7中重现。我很失望;)
答案 0 :(得分:0)
The {DIV} tag generated height is only 1px instead of 20px.