473,230 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

invoking method from dataGridView1_CellClick with passthru to CellDoubleClick

how do I call a method from CellClick if a user performs a single click on a
datagridview row and the same time allowing a double click event to be
passed onto CellDoubleClick if the user performs a double click action? As
it is now, the CellClick traps the single click event but does not allow a
double click to pass through to the CellDoubleClick event.
I do have to call a method from the CellClick event so I can't remove that
method.
Thanks, -hazz

private void dataGridView1_CellClick(object sender,DataGridViewCellEventArgs
e)
{
bSingleCellClick = true;
foo (arg1);
}
private void dataGridView1_CellDoubleClick(object sender,
DataGridViewCellEventArgs e)
{
if (bSingleCellClick)
{
ShowCustomerID(dataGridView1.CurrentCell.ColumnInd ex);
} else
{
Form2 f = new Form2();
f.Show();
}
}
Feb 14 '06 #1
1 5224
I had to use RowHeaderMouseClick and CellDoubleClick as below to get the
separation of click and doubleclick actions.
this.dataGridView1.CellDoubleClick += new
System.Windows.Forms.DataGridViewCellEventHandler( this.dataGridView1_CellDoubleClick);

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

"hazz" <ha**@sonic.net> wrote in message
news:eW****************@TK2MSFTNGP14.phx.gbl...
how do I call a method from CellClick if a user performs a single click on
a datagridview row and the same time allowing a double click event to be
passed onto CellDoubleClick if the user performs a double click action?
As it is now, the CellClick traps the single click event but does not
allow a double click to pass through to the CellDoubleClick event.
I do have to call a method from the CellClick event so I can't remove that
method.
Thanks, -hazz

private void dataGridView1_CellClick(object
sender,DataGridViewCellEventArgs e)
{
bSingleCellClick = true;
foo (arg1);
}
private void dataGridView1_CellDoubleClick(object sender,
DataGridViewCellEventArgs e)
{
if (bSingleCellClick)
{
ShowCustomerID(dataGridView1.CurrentCell.ColumnInd ex);
} else
{
Form2 f = new Form2();
f.Show();
}
}

Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rafal 'Raf256' Maj | last post by:
Hi, Warning: passthru() has been disabled for security reasons in ... how can I change my php.ini file (php4/apache/winxp server) to enable this function? How can I best work around if I can't...
0
by: Yemi | last post by:
Hi There. I seem to be getting some inconsistent results when using passthru() in safe mode. They appear to be related to the fact that passthru should treat all command arguments as one single...
3
by: Jerry | last post by:
I've found a problem with exec, passthru, shell_exec & system. I'm trying to run the following exec("sort -r -n -k2,2 r1.txt > r2.txt") with r1.txt being a numeric file. The file looks like...
2
by: Greg Chapman | last post by:
I am at my wit's end trying to get information out of Streamline.net's support dept about my problem. They reply quickly enough, but seem to try and give out the least possible amount of info each...
2
by: Martin Kofahl | last post by:
Hello, I'm slightly confused with the passthru() command. The program I call writes html headers itself. However, passthru() makes apache sending some generated headers first. There's no fault...
2
by: Robertico | last post by:
Hi, I tried to use the Passthru and System function to resolve some whois information. echo passthru('whois 62.69.168.12') .'<br>'; -or- $whois = system('whois 62.69.168.12', $retval); It...
2
by: Jeff | last post by:
I am trying to dynamically load an assembly via reflection and then invoke a method of that assembly that will populate a custom type collection passed into the method byref. I am able to...
25
by: MuZZy | last post by:
Hi, I'm currently rewriting some functionality which was using multithredaing for retrieving datasets from database and updating a grid control. I found that the grids (Infragistics UltraGrid,...
1
by: Suds | last post by:
Hi, I'm having an issue with invoking a Generic method that takes Generic Arguments. My method signature is public void GenericMethodWithGenericArguments<E, V>(List<EtheFirstList,...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.