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. Editable Grid On Keypress

Editable Grid On Keypress

Scheduled Pinned Locked Moved C#
csstutorial
7 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.
  • A Offline
    A Offline
    Archana New to Dotnet
    wrote on last edited by
    #1

    Hi All, Can any one please tell me how to make a grid editable on a keypress. My exact requirement is I have a Gridview1 which has the edit column and can be updated. but I have been asked to do it in a keypress for eg. if some press F2 the row should be Editable. Thanks in Advance

    N J 2 Replies Last reply
    0
    • A Archana New to Dotnet

      Hi All, Can any one please tell me how to make a grid editable on a keypress. My exact requirement is I have a Gridview1 which has the edit column and can be updated. but I have been asked to do it in a keypress for eg. if some press F2 the row should be Editable. Thanks in Advance

      N Offline
      N Offline
      Nouman Bhatti
      wrote on last edited by
      #2

      you can code in keypress event to check for F2 key press and then set the edit mode of your grid forexample dataGridView1.EditMode = DataGridViewEditMode.EditOnEnter;

      1 Reply Last reply
      0
      • A Archana New to Dotnet

        Hi All, Can any one please tell me how to make a grid editable on a keypress. My exact requirement is I have a Gridview1 which has the edit column and can be updated. but I have been asked to do it in a keypress for eg. if some press F2 the row should be Editable. Thanks in Advance

        J Offline
        J Offline
        Jacky Yiu
        wrote on last edited by
        #3

        2 simple way to complete your requirement. 1.) add a menustrip in your application, then add an item and set the shortcut to f2 2.) add a keyboard event handler in your app and detect if key == Key.f2 either way to fire a function to set the gridview tobe edit mode.

        A 1 Reply Last reply
        0
        • J Jacky Yiu

          2 simple way to complete your requirement. 1.) add a menustrip in your application, then add an item and set the shortcut to f2 2.) add a keyboard event handler in your app and detect if key == Key.f2 either way to fire a function to set the gridview tobe edit mode.

          A Offline
          A Offline
          Archana New to Dotnet
          wrote on last edited by
          #4

          Sorry I forgot to mention that Im in Developing WEB APPLICATION

          J 1 Reply Last reply
          0
          • A Archana New to Dotnet

            Sorry I forgot to mention that Im in Developing WEB APPLICATION

            J Offline
            J Offline
            Jacky Yiu
            wrote on last edited by
            #5

            you can add a javascript event capture the keypress, if event == f2, then fire the callback and set the gridview as editmode. FYR. function dosomething() { var key = window.event.keyCode; alert(key); }

            A 1 Reply Last reply
            0
            • J Jacky Yiu

              you can add a javascript event capture the keypress, if event == f2, then fire the callback and set the gridview as editmode. FYR. function dosomething() { var key = window.event.keyCode; alert(key); }

              A Offline
              A Offline
              Archana New to Dotnet
              wrote on last edited by
              #6

              Since f2 is a functional key ..can you please tell how to get the keypress value for it

              A 1 Reply Last reply
              0
              • A Archana New to Dotnet

                Since f2 is a functional key ..can you please tell how to get the keypress value for it

                A Offline
                A Offline
                Archana New to Dotnet
                wrote on last edited by
                #7

                got it through onkeydown event thank you

                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