如何禁用“拉伸”对于列表?
我在 Windows 窗体应用程序 (vb.net) 中有一个 ReportViewer。
我有一份包含列表的报告,该列表只有 1 或 2 层深。如果列表中有 2 个项目,我不希望周围的报告呈现“拉伸”状态。是否有一个属性可以切换以关闭拉伸?
干杯。
I have a ReportViewer in a Windows Forms application (vb.net).
I have a report with a list in it, and the list will only be 1 or 2 deep. I don't want the surrounding report to render 'stretched' if the list has 2 items in it. Is there a property I can toggle to turn off stretching?
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这假设 SQL Reporting Services 或 ReportViewer 控件...
您应该能够设置 CanGrow = false列表项上的 。
如果这不起作用,请将列表放在矩形内 并在矩形上设置CanGrow。
This assume SQL Reporting Services or a ReportViewer control...
You should be able to set CanGrow = false on the List item.
If this doesn't work, put the list inside a rectangle and set CanGrow on the rectangle.
您在这里谈论的是 WPF 应用程序吗?您的容器是否会根据其内容自动调整大小?您可以设置控件的精确高度,例如
,或者您可以执行我在 GUI 中喜欢执行的操作,即选择用于呈现信息的关键视觉元素,并确保自动调整窗口本身的大小。如果您使用诸如 DockPanel 之类的容器,则 XAML 中定义的最后一个子级将自动调整自身大小以填充
Window
的其余部分或包含它的任何其他控件。Are you talking about a WPF application here? Is the issue that your container is auto-sizing to its content? You can either set the exact height of the control, e.g.
or you can do what I prefer to do in my GUIs, which is to pick the critical visual element for presenting information, and make sure that autosizes to the window itself. If you use a container like a
DockPanel
, the last child defined in XAML will automatically size itself to fill the remainder of theWindow
, or whatever other control it's contained by.