473,938 Members | 11,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

invoking method from dataGridView1_C ellClick 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_C ellClick(object sender,DataGrid ViewCellEventAr gs
e)
{
bSingleCellClic k = true;
foo (arg1);
}
private void dataGridView1_C ellDoubleClick( object sender,
DataGridViewCel lEventArgs e)
{
if (bSingleCellCli ck)
{
ShowCustomerID( dataGridView1.C urrentCell.Colu mnIndex);
} else
{
Form2 f = new Form2();
f.Show();
}
}
Feb 14 '06 #1
1 5256
I had to use RowHeaderMouseC lick and CellDoubleClick as below to get the
separation of click and doubleclick actions.
this.dataGridVi ew1.CellDoubleC lick += new
System.Windows. Forms.DataGridV iewCellEventHan dler(this.dataG ridView1_CellDo ubleClick);

this.dataGridVi ew1.RowHeaderMo useClick += new
System.Windows. Forms.DataGridV iewCellMouseEve ntHandler(this. dataGridView1_R owHeaderMouseCl ick);

"hazz" <ha**@sonic.net > wrote in message
news:eW******** ********@TK2MSF TNGP14.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_C ellClick(object
sender,DataGrid ViewCellEventAr gs e)
{
bSingleCellClic k = true;
foo (arg1);
}
private void dataGridView1_C ellDoubleClick( object sender,
DataGridViewCel lEventArgs e)
{
if (bSingleCellCli ck)
{
ShowCustomerID( dataGridView1.C urrentCell.Colu mnIndex);
} 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
7176
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 use this function? -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~
0
2224
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 argument when safe mode is on. Everything works just fine on my MacOS X webserver ( Apache 1.3.29 with PHP 4.3.6 ). But on my Linux Enterprise 3.0 production server (running Apache 2.0.46 with PHP 4.3.2) things are different.
3
3399
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 this: 237 291 845 152 585 3 193 810 173 484 151 3
2
5303
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 time. The transcript so far is reproduced for your amusement below. To summarise: I've put up a Sudoku-solving program called Sudoku.exe. I want to call it in a php script to solve a puzzle and output the solution. It works fine with...
2
2851
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 with spaches in the code etc, I think. Here's an simplified example: $ cat /www/example.php <?
2
2263
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 works fine, but all the result text is at one line. How can i format this
2
7786
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 dynamically load both the DALC component (for the method call) and the Entity component (for the custom type collection to pass in), but I keep getting an error ( Message "Object type cannot be converted to target type.") when invoking the method. If I...
25
2545
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, though it doesn't matter) were updated (i.e. grid.DataSource = dsDataSet;) and used for different purposes in the worker thread, so now i'm wrapping all those calls to grid's methods thru invoking which is a pain in the a$$ considering number of...
1
2794
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, List<VtheSecondList); I pass the name of the method, the arguments for the "GenericMethodWithGenericArguments" to another method, which is supposed to invoke this method using the Invoke method in the MethodInfo class. My process of invocation is as follows
0
9963
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11521
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9854
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6072
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6292
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4444
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.