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. Windows Forms
  4. ColumnHeaderMouseDoubleClick event

ColumnHeaderMouseDoubleClick event

Scheduled Pinned Locked Moved Windows Forms
question
2 Posts 2 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.
  • T Offline
    T Offline
    tthellebuyck
    wrote on last edited by
    #1

    I have a DataGridView on a windows form. If a user clicks on a cell, a property gets the current row and then populates data in another form. When a cell is highlighted, if a user double clicks on the columnheaders the modal form loads with the data from the highlighted row. I want to stop users from being able to double click on the column headers. Does anyone have any suggestions on how I could do this? Thanks, Taylor

    B 1 Reply Last reply
    0
    • T tthellebuyck

      I have a DataGridView on a windows form. If a user clicks on a cell, a property gets the current row and then populates data in another form. When a cell is highlighted, if a user double clicks on the columnheaders the modal form loads with the data from the highlighted row. I want to stop users from being able to double click on the column headers. Does anyone have any suggestions on how I could do this? Thanks, Taylor

      B Offline
      B Offline
      bttds
      wrote on last edited by
      #2

      Your question is not very clear to me. If you want to do something when you double click on a cell (and avoid doing anything if the user double clik on the header) you can do something like this, private void gvList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int miHitRow = Convert.ToInt32(e.RowIndex); if (miHitRow < 0) return; //your code }

      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