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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to add scroll Horigental scroll bar in the call of DataGridView in window .net

How to add scroll Horigental scroll bar in the call of DataGridView in window .net

Scheduled Pinned Locked Moved C#
csharpdatabasetutorial
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.
  • M Offline
    M Offline
    Member 4659001
    wrote on last edited by
    #1

    How to add scroll Horigental scroll bar in the call of DataGridView Now each X seconds, the datagrid is updated with data from the database. So the datagridview is refreshed. I also want to maintains the position of scroll bar even after datagridview is refreshed. When a user is working on row X, and column Y, and the datagrid is refreshed all the scrollbars get back at position 0. So the horizontal scrollbar is put back to the left side of the screen, and the vertical scrollbar is put back on the top of the screen.

    Raghvendra

    M 1 Reply Last reply
    0
    • M Member 4659001

      How to add scroll Horigental scroll bar in the call of DataGridView Now each X seconds, the datagrid is updated with data from the database. So the datagridview is refreshed. I also want to maintains the position of scroll bar even after datagridview is refreshed. When a user is working on row X, and column Y, and the datagrid is refreshed all the scrollbars get back at position 0. So the horizontal scrollbar is put back to the left side of the screen, and the vertical scrollbar is put back on the top of the screen.

      Raghvendra

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      //Store the scrollposition
      int _xScrollPosition = dataGridView1.HorizontalScrollingOffset;
      //update the datagridview
      dataGridView1.HorizontalScrollingOffset = _xScrollPosition;

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      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