让 Infragistics UltraWinGrid 在添加或删除行时调整高度大小

发布于 2024-12-01 12:13:14 字数 110 浏览 7 评论 0原文

我正在寻找最佳方法来根据其绑定的行数来更改 UltraWinGrid 的垂直高度,以便所有行都可见且没有滚动条。目的是在滚动面板中垂直堆叠多个网格,以便在必要时仅显示单个面板滚动条,而不是每个网格的滚动条。

I am looking for the best approach to getting the vertical height of a UltraWinGrid to change based on the number of rows it is bound to such that all rows are visible with no scroll bar. The intention is to stack several grids vertically in a scroll panel so only a single panel scroll bar appears when necessary rather than a scroll bar for each grid.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不离久伴 2024-12-08 12:13:14

基本上,该方法取决于 UltraGrid 的当前设置。假设所有行的高度相同,则可以使用如下所示的内容:

int gridHeight = ultraGrid1.Rows.Count *ultraGrid1.DisplayLayout.Override.DefaultRowHeight + ultraGrid1.DisplayLayout.Bands[0].Columns[0]。 Header.Height + ultraGrid1.DisplayLayout.Bands[0].Header.Height + someConst;

列标题和带标题可能不会出现在您的布局中。这
“someConst”引用“BorderStyleRow”属性,因为在计算 UltraGrid 高度时还应考虑行边框。您需要考虑的另一件事是 GroupByBox 的高度(如果它在 UltraGrid 中可见)。

如果此方法不适合您,请向我提供有关 UltraGrid 中确切设置的更多详细信息,以便我将尽力进一步帮助您解决此问题。

Basically the approach would depend on the current settings of your UltraGrid. Assuming that you have all rows with the same height than you could use something like the following:

int gridHeight = ultraGrid1.Rows.Count *ultraGrid1.DisplayLayout.Override.DefaultRowHeight + ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.Height + ultraGrid1.DisplayLayout.Bands[0].Header.Height + someConst;

Where the Column header and the Band header might not present into your layout. The
"someConst" refering to the "BorderStyleRow" property becasue the row border should also be taken into account when calculating the UltraGrid height. One more thing that you would like to consider would be the height of the GroupByBox if it is visible in your UltraGrid.

If this approach does not work for you please provide me more details of exact settings in your UltraGrid so I will try to assist you further with this matter.

梦屿孤独相伴 2024-12-08 12:13:14

以下帖子有一个获取 UltraWinGrid 高度的示例,可能是您的一个很好的起点:
http://blogs.infragistics.com/forums/p/18548/321187 .aspx#321187

The following post has a sample that gets the height of a UltraWinGrid and may be a good starting point for you:
http://blogs.infragistics.com/forums/p/18548/321187.aspx#321187

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文