使 silverlight TreeView 控件变得不那么笨重?
我对 Silverlight 很陌生。我已经下载了 VS 2010,这样我就可以以更图形化的方式使用 silverlight,而不必为 Expression Blend 3 支付大量费用。所以,如果这是一个明显的问题,请仁慈。
默认情况下,在树视图中,所有节点都是折叠的。我可以让它们展开,但我希望它们始终展开,但也不会像禁用控件时那样变灰。做到这一点最简单的方法是什么? (我基本上只是不希望那里有展开/折叠按钮)
另外,我不喜欢树节点占用的空间。我在每个节点中只有一行文本。我希望它的间距小一点。现在它看起来大约是三倍间距,我想要更接近单倍间距或 1.5 倍间距的东西。
I'm very new to Silverlight. I've downloaded VS 2010 so that I can mess around with silverlight in a more graphical way and without having to pay a ton of money for Expression Blend 3.. So please have mercy if this is an obvious question.
By default, in a tree view, all of the nodes are collapsed. I can get these to expand, but I want for them to always be expanded, but also not grayed out like they are when you disable the control. What's the easiest way of doing this? (I basically just don't want that expand/collapse button there)
Also, I dislike how much space the tree nodes take up. I just have one line of text in each node. I would like it to be a little less spaced out. Right now it looks about like triple spacing between it, and I'd like something closer to single spacing or 1.5 spacing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 .cs 文件中,您可以在 TreeView 控件上调用 ExpandAll()。
您可以在每个 TreeViewItem 上使用样式来设置边距和填充,以避免出现空白区域。
In your .cs file your can call ExpandAll() on the your TreeView control.
You can use styles on each TreeViewItem to set the margin and padding to avoid the empty space.