Datagridview properties to test in CellContentClick or RowEnter event handlers

H

hazz

so that when a user clicks or double clicks on a datagridview row,
private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs
e) {}and

private void dataGridView1_CellContentClick(object sender,
DataGridViewCellEventArgs e){}

handle any incoming events in a reliable and consistent manner.

Requirements:
1. no actions are performed in these event handlers during the
datagridview intialization.
2. the ability to select a single row only after the datagridview has been
initialized and displayed.
(given dataGridView1.SelectionMode =
DataGridViewSelectionMode.FullRowSelect; )
3. the double click event action is not pre-empted by a single event.

Thank you, -Greg
 
H

hazz

ok. I want cellclick and doublecellclick. Now I have to find out how to not
have the cellclick fire (when calling another method) and still have the
doublecellclick event fire. -hazz
 
H

hazz

I had to use RowHeaderMouseClick and CellDoubleClick as below to get the
separation of click and doubleclick actions.
They use different Event Handlers

this.dataGridView1.CellDoubleClick += new
System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);

this.dataGridView1.RowHeaderMouseClick += new
System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView1_RowHeaderMouseClick);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top