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. C#;how to trace DataGridView's click event

C#;how to trace DataGridView's click event

Scheduled Pinned Locked Moved C#
csharpdebugginghelptutorial
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.
  • K Offline
    K Offline
    kssknov
    wrote on last edited by
    #1

    hi can u pls help me how to trace the DataGridview's cell click event. thnks

    senthil

    U 1 Reply Last reply
    0
    • K kssknov

      hi can u pls help me how to trace the DataGridview's cell click event. thnks

      senthil

      U Offline
      U Offline
      Ujjaval Modi
      wrote on last edited by
      #2

      Hi, Can you please elaborate that exactly what you want to do; because datagridview does have a CellClick Event.

      Regards, Ujjaval Modi :) Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.

      K 1 Reply Last reply
      0
      • U Ujjaval Modi

        Hi, Can you please elaborate that exactly what you want to do; because datagridview does have a CellClick Event.

        Regards, Ujjaval Modi :) Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.

        K Offline
        K Offline
        kssknov
        wrote on last edited by
        #3

        hi i have a datagridview contrl which populates a column from table thru dataset. when i click, or browse through arrow keys , the current cells items should be shown in textboxes for edition.(the selected cell item is key value, i pass it to storedproc and select its other fields to show in textboxes) i had did this through a button click as follows private void button1_Click(object sender, EventArgs e) { dsGridToTxtBx = obj._selectGridCellAreaDetails(DataGrdVw1.CurrentCell.Value.ToString()); { AreaIdValue = dsGridToTxtBx.Tables[0].Rows[0].ItemArray[0].ToString(); //here retrieved other fields are displayed in two text boxes txtAreaName.Text = dsGridToTxtBx.Tables[0].Rows[0].ItemArray[1].ToString(); //textbox1 txtRegion.Text = dsGridToTxtBx.Tables[0].Rows[0].ItemArray[2].ToString();//textbox2 } } also i tried like this but this doesnt works? :doh: private void DataGrdVw1_CellClick(object sender, DataGridViewCellEventArgs e) { string CurrentSelValue; CurrentSelValue = DataGrdVw1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); txtAreaName.Text = CurrentSelValue; } i would thank if anybody gives me solution kssk

        kssk/div>

        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