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.