如何访问 TCRDBGrid 组件中的搜索文本?
有没有办法访问在 Devart(核心实验室)TCRDBGrid 搜索栏中输入的文本?
我尝试实现 OnKeyDown 事件,但仅当选择网格本身时,在搜索字段中输入时该事件才发生。没有其他看起来相关的事件。
文本似乎进入 TEdit,它是 TCRGridTitleEdit 的一部分,TCRGridTitleEdit 是 TCRDBGrid 的一部分,但是私有的。
有没有办法获取搜索文本?
示例 TCFGBGrid:
+---------+------------+
| UserId | UserName | <- Column titles
+---------+------------+
|[987654] | [ ] | <- Search bar (searching for UserId 987654)
+---------+------------+
| 123456 | Wile Cau | <- Data
+---------+------------+
| ... | ... | <- More data
如果 UserId 987654 不存在,我想提示“创建新用户 987654?”并可能创建一条新记录,并将 UserId 设置为 987654。
Is there a way to access the text entered in a Devart (Core Lab) TCRDBGrid search bar?
I tried implementing the OnKeyDown event but the event didn't happen during entry in the search fields, only when the grid itself was selected. There are no other events that look relevant.
The text appears to go into a TEdit which is part of a TCRGridTitleEdit, which is part of TCRDBGrid but is private.
Is there a way to get the search text?
Example TCFGBGrid:
+---------+------------+
| UserId | UserName | <- Column titles
+---------+------------+
|[987654] | [ ] | <- Search bar (searching for UserId 987654)
+---------+------------+
| 123456 | Wile Cau | <- Data
+---------+------------+
| ... | ... | <- More data
If UserId 987654 doesn't exist, I want to prompt something like "Create new user 987654?" and potentially create a new record with UserId set to 987654.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TCRDBGrid 随源代码一起分发。您可以修改源代码:
声明事件类型:
在TCRGridTitleEdit类中添加事件声明:
在ProcessEdit过程中调用该事件:
并在TCRDBGrid类中添加事件声明:
实现
TCRDBGrid is distributed with source code. You can modify source code:
declare the event type:
add event declaration in the TCRGridTitleEdit class:
call this event in the ProcessEdit procedure:
and add event declaration in the TCRDBGrid class:
implementation