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. datagrid view scroll

datagrid view scroll

Scheduled Pinned Locked Moved C#
questionhelp
3 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.
  • F Offline
    F Offline
    faladrim
    wrote on last edited by
    #1

    hi, i have a problem with my datagridview, well not realy a problem, but you know... if i add a new row, the selected cell is the first row again, and if i have more rows then u can see you dont know if there is one added or not unless you scroll down. i want my view to be on the last added row instead of the first. how can i do this? thx

    R 1 Reply Last reply
    0
    • F faladrim

      hi, i have a problem with my datagridview, well not realy a problem, but you know... if i add a new row, the selected cell is the first row again, and if i have more rows then u can see you dont know if there is one added or not unless you scroll down. i want my view to be on the last added row instead of the first. how can i do this? thx

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Hi, I think setting CurrentCell to some cell of the newly added row will let the DataGridView automatically scroll to this one. Robert

      F 1 Reply Last reply
      0
      • R Robert Rohde

        Hi, I think setting CurrentCell to some cell of the newly added row will let the DataGridView automatically scroll to this one. Robert

        F Offline
        F Offline
        faladrim
        wrote on last edited by
        #3

        this works, thx index = dataGridView1.Rows.GetLastRow(DataGridViewElementStates.Visible); dataGridView1.CurrentCell = dataGridView1[0, index];

        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