Search code examples
c#winformsdevexpressgridcontrol

Add 'expand details' button on Devexpress gridcontrol cell


I have a gridcontrol with a few columns. 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.

I was thinking of button with a little plus sign to expand this view, on each cell. Any advice would be appreciated.

Thanks


Solution

  • Use a RepositoryButtonEdit and handle the Click event:

    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