Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Double click event on column in datagrid

How do I write the code to check if a user double clicks in a certain column ...let's column index of 3??
0
Richard Kreidl
Asked:
Richard Kreidl
  • 4
  • 2
1 Solution
 
rgn2121Commented:
Is this a DataGridView?  
0
 
Richard KreidlSoftware DeveloperAuthor Commented:
yes
0
 
rgn2121Commented:
In the Double_Click event....
 

        If Not IsNothing(DataGridView1.CurrentCell) Then
            If DataGridView1.CurrentCell.ColumnIndex = 3 Then
 
            End If
        End If

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rgn2121Commented:
This will work if they click in a cell...you would have to check if they have clicked on a column header.  Without really testing it, I can't say if there is anything else to check for..
0
 
Richard KreidlSoftware DeveloperAuthor Commented:
thanks!!!
0
 
rgn2121Commented:
Also, I think if the user clicks a Column or Row header then the ColumnIndex = 0...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now