gpt4 book ai didi

delphi - 根据主记录值在 TCXGrid 中隐藏 TcxGridLevel

转载 作者:行者123 更新时间:2023-12-02 06:14:24 25 4
gpt4 key购买 nike

我有一个 TcxGrid,它由一个主 TcxGridLevel 和 2 个子 TcxGridLevel 组成(所有这些都使用 TcxGridDBTableView)。我想根据主级别记录值的值隐藏子级别之一。我该怎么办?

最佳答案

这里是 DevExpress 的链接,描述了您想要的内容:

https://www.devexpress.com/Support/Center/Question/Details/Q96738

但我认为这有一些缺点。首先,对于较大的数据集来说,速度相当慢。其次,当你的大师级别频繁变化并且必须重新绘制网格时,就会出现“闪烁”。也许可以为您的详细数据集设置一个过滤器,以便当您的 nmaster 具有正确的条件时,详细信息为“空”。 TcxGrid 中有一个属性可以自动隐藏空的详细信息选项卡。

有点断章取义,但万一链接再次失效:

1) How can I trigger Level3 OnGetGridView, because Level3 View was not change as I was expected

The OnGetGridView event is raised only once when the detail is first expanded. After the event handler has been executed, the specified GridView’s clone is created and cached so that the event doesn't fire when expanding the same master record next times. If you need the event to be raised later, you can clear all detail clones by calling the master DataController’s ClearDetails method or ClearDetailLinkObject methods.

You can find this information in the "TcxGridLevel.OnGetGridView" topic of the ExpressQuantumGrid's documentation.

2) I am also changing Level2 and Level3 Caption for every Gridview that it showing, but the changing is not automatically, sometime the Detail View need to be close and open again to make the Caption change.

If we're not mistaken, you change the Level's Caption in its OnGetGridView event handler. If so, the new caption isn't applied immediately because painting of the corresponding element isn't completed. As a workaround, you can perform a "delayed" operation by posting a custom message. I've attached a sample project to illustrate this approach in action. Hopefully, it will serve your needs, and adapting it won't be aproblem.

关于delphi - 根据主记录值在 TCXGrid 中隐藏 TcxGridLevel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6189740/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com