Xtragrid - Grdview - Click event

Asked

Viewed 116 times

0

Good morning, you guys. How are you?

I’m having a hard time implementing an event by clicking on Gridview. I’m using the components of Devexpress, Xtragrid.Gridview.

Well, I’m adding the event:

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

who calls 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);
    }

However, when clicking on the table, nothing happens, I went after the documentation on the Devexpress website, and found: Help Devexpress website

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.

From what I understand, if column editing is activated, the event does not occur, is that it? someone could give me clarified?

Thank you.

1 answer

0

You guys, this is it.

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

For the Click event to occur, add the line below in the gridview options:

AllowEdit = False

Thanks

Browser other questions tagged

You are not signed in. Login or sign up in order to post.