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 Focus to specific cell

Datagridview Focus to specific cell

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

    Hi All, i am using DataGridView which contains 4 Columns in my c# 2005 application . When the user types some data in Column 1 and press enter the focus should go to Column 3 (or some other column) of the same row. in short how can i do programmatically set focus to specific cell(column) in a DataGridView. how can i achive this i serached info but not able to find any relavent data .

    L 1 Reply Last reply
    0
    • V Vijjuuu

      Hi All, i am using DataGridView which contains 4 Columns in my c# 2005 application . When the user types some data in Column 1 and press enter the focus should go to Column 3 (or some other column) of the same row. in short how can i do programmatically set focus to specific cell(column) in a DataGridView. how can i achive this i serached info but not able to find any relavent data .

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Vijjuuuuuuuuu........... wrote:

      in short how can i do programmatically set focus to specific cell(column) in a DataGridView

      By setting the CurrentCell[^] property :)

      I are Troll :suss:

      V 1 Reply Last reply
      0
      • L Lost User

        Vijjuuuuuuuuu........... wrote:

        in short how can i do programmatically set focus to specific cell(column) in a DataGridView

        By setting the CurrentCell[^] property :)

        I are Troll :suss:

        V Offline
        V Offline
        Vijjuuu
        wrote on last edited by
        #3

        Hi Eddy, Thanks for you reply . sorry to ask you again not clear with the example given , my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .

        L 1 Reply Last reply
        0
        • V Vijjuuu

          Hi Eddy, Thanks for you reply . sorry to ask you again not clear with the example given , my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Vijjuuuuuuuuu........... wrote:

          my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .

          You can set the input-focus using the property "CurrentCell", like this;

          dataGridView1.CurrentCell = dataGridView1[3, 4];

          There's a "howto" article on this subject on MSDN[^] :)

          I are Troll :suss:

          V 1 Reply Last reply
          0
          • L Lost User

            Vijjuuuuuuuuu........... wrote:

            my requirment is ,focus should move to paticular cell (i will specify the row and column number) when the user is inputing the data .

            You can set the input-focus using the property "CurrentCell", like this;

            dataGridView1.CurrentCell = dataGridView1[3, 4];

            There's a "howto" article on this subject on MSDN[^] :)

            I are Troll :suss:

            V Offline
            V Offline
            Vijjuuu
            wrote on last edited by
            #5

            Thank you very much for your prompt reply . Now i am facing new problem, celling focusing is not correct. its is focusing one row next to mentioned index . for example i have 4 columns for my grid. dataGridView1.CurrentCell = dataGridView1[0,2]; for the above code the focus to [1,2] any idea ? if not pls igorne my quesiton.

            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