Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DataGridView event arguments

DataGridView event arguments

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eyalbi007
    wrote on last edited by
    #1

    Hi, This question may be a bit silly, but I still can't figure it out: When entering a DataGridView DoubleClick event handler function (DataGridView1_DoubleClick(object sender, EventArgs e), e only has basic methods (Equals(), ToString() etc.). However, at run time, e also have a 'Location' field, which I need. If I try to compile a code contains e.Location, it won't compile... At google I found people that use e.RowIndex, but I don't have that one either... Please help. Thanks!

    R A J 3 Replies Last reply
    0
    • E eyalbi007

      Hi, This question may be a bit silly, but I still can't figure it out: When entering a DataGridView DoubleClick event handler function (DataGridView1_DoubleClick(object sender, EventArgs e), e only has basic methods (Equals(), ToString() etc.). However, at run time, e also have a 'Location' field, which I need. If I try to compile a code contains e.Location, it won't compile... At google I found people that use e.RowIndex, but I don't have that one either... Please help. Thanks!

      R Offline
      R Offline
      rah_sin
      wrote on last edited by
      #2

      check whether u have imported all the files related to DataGridView properly.

      rahul

      1 Reply Last reply
      0
      • E eyalbi007

        Hi, This question may be a bit silly, but I still can't figure it out: When entering a DataGridView DoubleClick event handler function (DataGridView1_DoubleClick(object sender, EventArgs e), e only has basic methods (Equals(), ToString() etc.). However, at run time, e also have a 'Location' field, which I need. If I try to compile a code contains e.Location, it won't compile... At google I found people that use e.RowIndex, but I don't have that one either... Please help. Thanks!

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        Using VS2008 I have the same thing, e has very few methods. I got aroung it by this: DataGridViewRow curRow = datagridview.CurrentRow; I could then use all the columns etc from curRow. Hope this helps

        Bob Ashfield Consultants Ltd

        1 Reply Last reply
        0
        • E eyalbi007

          Hi, This question may be a bit silly, but I still can't figure it out: When entering a DataGridView DoubleClick event handler function (DataGridView1_DoubleClick(object sender, EventArgs e), e only has basic methods (Equals(), ToString() etc.). However, at run time, e also have a 'Location' field, which I need. If I try to compile a code contains e.Location, it won't compile... At google I found people that use e.RowIndex, but I don't have that one either... Please help. Thanks!

          J Offline
          J Offline
          John Ad
          wrote on last edited by
          #4

          Hi, On double clicking on the grid, the event invoked is:

          Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

          End Sub
          

          this gives RowIndex and ColumnIndex, whereas you will get e.location under the mouse click events, such as:

          Private Sub DataGridView1_CellMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseDoubleClick

          End Sub
          

          Hope this helps.

          Vinay ComponentOne LLC. www.componentone.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups