XtraGrid - GrdView - Click event

0
Well, guys, good morning. How are you?

I'm having a hard time implementing an event when I click the GridView. I'm using the DevExpress components, XtraGrid.GridView.

Well, I'm adding the event:

this.gridView1.Click += new System.EventHandler(this.click_datagridview1);

Calling my method:

 private void click_datagridview1(object sender, EventArgs e)
    {
        string v = Convert.ToString(gridView1.GetRowCellValue(gridView1.GetSelectedRows()[0], "ID")); //sintexe correta
        MessageBox.Show("Valor da coluna ID " + v);
    }

But clicking on the table, nothing happens, I went behind the documentation on the DevExpress website, and found: Site Help DevExpress

The Click event occurs when the end-user clicks within a View. If clicking a grid cell activates a column editor, the Click event does not occur. Before the Click event, the MouseDown event is generated. This occurs whenever the end-user presses the mouse key.

Please refer to the Hit Information Overview topic for information on how to determine which element has been clicked.

As I understand it, if column editing is enabled, the event does not occur, is it? could anyone give me clarity?

Thank you.

    
asked by anonymous 01.07.2016 / 14:14

1 answer

0

Well, that's it.

If column editing is enabled, the event does not occur.

For the Click event to occur, you must add the row below in the gridview options:

AllowEdit = False

Thanks

    
01.07.2016 / 14:23