简体   繁体   English

在Devexpress网格控制单元上添加“扩展详细信息”按钮

[英]Add 'expand details' button on Devexpress gridcontrol cell

I have a gridcontrol with a few columns. 我有一个带有几列的gridcontrol。 I want a way to expand a specific cell, displaying a popup with additional information. 我想要一种扩展特定单元格的方法,显示带有其他信息的弹出窗口。

Basically, the column is 'Message', which is of type string, and I want to be able to click on individual cells in this column and display a popup with additional details. 基本上,该列是“消息”,其类型为字符串,我希望能够单击此列中的单个单元格,并显示一个包含其他详细信息的弹出窗口。 It is a Devexpress gridcontrol. 这是一个Devexpress gridcontrol。

I was thinking of button with a little plus sign to expand this view, on each cell. 我正在考虑在每个单元格上加一点加号的按钮来扩展此视图。 Any advice would be appreciated. 任何意见,将不胜感激。

Thanks 谢谢

Use a RepositoryButtonEdit and handle the Click event: 使用RepositoryButtonEdit并处理Click事件:

private void buttonEdit1_ButtonPressed(object sender, ButtonPressedEventArgs e) {
    ButtonEdit editor = (ButtonEdit)sender;
    int buttonIndex = editor.Properties.Buttons.IndexOf(e.Button);
    if (buttonIndex == 0) 
    {
       MessageBox.Show("Aditional details");
    }
}

more info here and here 在这里这里更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM