有没有办法绘制具有动态尺寸(可拉伸)的自定义表格(网格)
我有一张桌子,它看起来很像:
首先我不知道如何制作这种结构稳定,因为我在通常的网格中发现的只是列和行,所以我需要一些“更智能”的表格元素。但也许我需要以某种方式创建它。也许有一些制作自定义结构化表的解决方案?
主要的麻烦是使表格完全可拉伸(如图片),因此表格必须随着文本(字体)而变大。我不知道目标平台分辨率,但它可能非常巨大,因此表格必须能够像图片一样拉伸,但质量良好,我不想在那里看到大像素(所以它必须像矢量图一样可拉伸)。我怎样才能意识到呢?
另外,我仍在考虑 WPF 是否是正确的工具。也许用 Silverligh 制作它或以某种方式将 HTML 放入应用程序中会更容易,但暂时我找不到方法如何在任何地方制作它。所以我想我也必须用 html 和 silver-light 标志来标记问题,但我想我无论如何都会使用 .net 从数据库获取数据。
I've got a table and it's looking alike that:
First I don't know how can I make such-structured stable, because all that I found in usual Grids is Columns and Rows so I need some "smarter" table element. But maybe I need to create it somehow. Maybe there are some solutions for making custom structured tables?
And the main trouble is make table fully stretchable (like a picture), So table must became bigger with text (Font) in it. I don't know target platform resolution but it can be really huge so table must have an ability to stretch like a picture but with good quality, I don't want to see big pixels there (so it must be stretchable like a vector picture). How can I realize it?
Also I'm still thinking if WPF is correct instrument for it. Maybe it will be easier to make it with Silverligh or put HTML into application somehow but for a moment I can't find way how can I make it everywhere. So I think I must as well tag the question with html and silver-light flags but I think I will use .net to get my data from database anyway.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我花了最后一个小时找到一个可靠的解决方案,但没有找到一个完美的解决方案。我停止搜索这一点,但想向您展示我当前的尝试:
GridControl.cs
在视图中使用:
I spend the last hour to find a reliable solution, but got not a perfect one.. I stop searching on this point but want to show you my current attempt:
GridControl.cs
Using in a view:
大多数人在面临必须创建这样的复杂网格时可能会购买第三方组件。特别是如果您不知道如何自己实施的话!
尝试环顾一下 .NET 组件供应商,例如:
所有这些都拥有功能相当丰富的网格。此外,如果您购买他们的产品,他们应该很乐意提供支持。
Most people, when faced with having to create a complex grid like this would probably purchase a third party component. Especially if you do not know how to implement it yourself!
Try looking round the .NET component vendors such as:
All have grids that are quite feature-rich. Also, if you are paying for their product, they should be happy to provide support.
尽管您想要实现的网格/表格结构背后有很多复杂性,但您问题的答案很简单。将所有内容放入 Viewbox 中,它将正确拉紧。由于 WPF 基于矢量图形,而不是像素,因此缩放不会有问题。
Despite all the complexity behind the grid/table structure you're trying to achieve, the answer to your question is simple. Put everything in a Viewbox and it will properly stretch. Since WPF is based on vector graphics, not pixels, scaling will be no issue.