删除 Flex DataGrid 中的空白行 (Flex 3)

发布于 2024-10-12 19:39:39 字数 342 浏览 4 评论 0原文

我遇到了类似于 如何使数据网格高度等于 Adob​​e Flex 中的数据内容,但是建议的答案对我不起作用。

DataGrid 末尾的空白行一开始不显示,直到我开始编辑最后一行,此时整个网格立即向上推,使顶行消失,空白底行重新出现。

Nikhil在那篇文章中的回答说,设置高度来计算包括标题在内的整体高度以及将verticalScrollPolicy设置为关闭仍然对我没有帮助。

I am encountering a problem similar to How can I make datagrid height is equal to data content in Adobe Flex however suggested answers did not work for me.

The blank row at the end of the DataGrid does not display at first, until I begin editing editing the last row, at which the entire grid is immediately pushed upwards, making the top row disappear and the blank bottom row reappear.

Nikhil's answer in that post said that setting the height to count the overall height including the header as well as setting the verticalScrollPolicy to off still did not help me.

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

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

发布评论

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

评论(3

淡紫姑娘! 2024-10-19 19:39:39

巴茨在那篇文章中的回答通常对我有用: 如何使datagrid高度等于Adobe Flex中的数据内容

然后设置

 dataGrid.VerticalScrollPolicy = ScrollPolicy.OFF;

Barts answer from that post usually does it for me: How can I make datagrid height is equal to data content in Adobe Flex

And then setting

 dataGrid.VerticalScrollPolicy = ScrollPolicy.OFF;
盛夏尉蓝 2024-10-19 19:39:39

将 headerHeight 添加到网格中,使其为我解决完全相同的问题。我没有看到任何相关性,但这就是 Flex 的滚动方式。

Added headerHeight to the grid to get it working for me for exactly the same problem. I don't see any correlation but that's how flex rolls.

天煞孤星 2024-10-19 19:39:39

尝试以下代码。这对我有用!

    contentDataGrid.dataProvider = orgData;
    //contentDataGrid.rowCount=orgData.length;
    contentDataGrid.height = ((orgData.length)*18 + contentDataGrid.headerHeight+5)

这里“18”是我的行高。由于我不想将 verticalScrollPolicy 设置为关闭,因此我在数据网格高度上额外添加了 5(以避免出现滚动条)。假设 orgData 是数据提供者。

Try the following code. It works for me!

    contentDataGrid.dataProvider = orgData;
    //contentDataGrid.rowCount=orgData.length;
    contentDataGrid.height = ((orgData.length)*18 + contentDataGrid.headerHeight+5)

Here '18' is my rowheight. As I don't want to set verticalScrollPolicyto off, I added an extra 5 to the datagrid height (to avoid the scrollbar).Assume orgData is the data provider.

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