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 row display

Datagridview row display

Scheduled Pinned Locked Moved C#
question
5 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.
  • P Offline
    P Offline
    printscreen12345
    wrote on last edited by
    #1

    Is there any method I can use to jump to a particular row in a datagridview so that that row is highlighted and is displayed as if the 1st row (those rows before it would be scrolled up to be viewed)?

    M O 2 Replies Last reply
    0
    • P printscreen12345

      Is there any method I can use to jump to a particular row in a datagridview so that that row is highlighted and is displayed as if the 1st row (those rows before it would be scrolled up to be viewed)?

      M Offline
      M Offline
      Mairaaj Khan
      wrote on last edited by
      #2

      Tryed all my best but still didn't find any method or way that bring up the specific row in the DataGridView. Well, if you want to select a specific row, you can do it as follows: DataGridView1.ClearSelection(); DataGridView1.Rows[index].Selected=true; where index is an integer variable holding a valid value, or instead of it you can pass an integer value. The ClearSelection method will clear the previous selected row(s). Best Regards. _____________________________ Success is not something to wait for, its something to work for.

      1 Reply Last reply
      0
      • P printscreen12345

        Is there any method I can use to jump to a particular row in a datagridview so that that row is highlighted and is displayed as if the 1st row (those rows before it would be scrolled up to be viewed)?

        O Offline
        O Offline
        Office Lineman
        wrote on last edited by
        #3

        Select it as indicated. Then, set the FirstDisplayedScrollingRowIndex[^] to that row. -- I've killed again, haven't I?

        M 1 Reply Last reply
        0
        • O Office Lineman

          Select it as indicated. Then, set the FirstDisplayedScrollingRowIndex[^] to that row. -- I've killed again, haven't I?

          M Offline
          M Offline
          Mairaaj Khan
          wrote on last edited by
          #4

          Thanks Office Lineman Its solved part of my problem too. now the code would be like that: DataGridView1.ClearSelection(); DataGridView1.Rows[index].Selected=true; DataGridView1.FirsDisplayedScrollingRowIndex=index; Thanks and Best Regards. _____________________________ Success is not something to wait for, its something to work for.

          P 1 Reply Last reply
          0
          • M Mairaaj Khan

            Thanks Office Lineman Its solved part of my problem too. now the code would be like that: DataGridView1.ClearSelection(); DataGridView1.Rows[index].Selected=true; DataGridView1.FirsDisplayedScrollingRowIndex=index; Thanks and Best Regards. _____________________________ Success is not something to wait for, its something to work for.

            P Offline
            P Offline
            printscreen12345
            wrote on last edited by
            #5

            Great and thanks!

            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