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. how can i make a full row select in a datagrid

how can i make a full row select in a datagrid

Scheduled Pinned Locked Moved C#
csharpquestionvisual-studio
3 Posts 3 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.
  • S Offline
    S Offline
    spy
    wrote on last edited by
    #1

    how can i make a full row select in a datagrid, without using the row headers? im using visual studio.net 2003

    N S 2 Replies Last reply
    0
    • S spy

      how can i make a full row select in a datagrid, without using the row headers? im using visual studio.net 2003

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Handle a mouse event and use HitTestInfo private void DataGrid1MouseDown(object sender, MouseEventArgs e) { HitTestInfo hit = DataGrid1.HitTest(e.X, e.Y); if( hit.Type == HitTestType.Cell ) DataGrid1.Select(hit.Row); }


      only two letters away from being an asset

      1 Reply Last reply
      0
      • S spy

        how can i make a full row select in a datagrid, without using the row headers? im using visual studio.net 2003

        S Offline
        S Offline
        Stu Richardson
        wrote on last edited by
        #3

        If you want this to be a permanent feature then I would do it by setting the grids SelectionMode property to be FullRowSelect. This can be done through code: dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; Or on the properties window.

        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