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. how to get the row index value in datagridview

how to get the row index value in datagridview

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

    hi i have a form name frmDataEntry with textboxCustID and textboxCustName and lookup form name frmCustAssist with texboxFilter, button Filter and datagridview then when i double click textboxCustID then frmCustAssist will show i have to look if customer already exist or not then if already exist i hav to get the value of row index ..then the custID and custName of that value selected will be fill in the formDataEntry in textboxCustID and textboxCustName how do code that that plz help my code is here.. in a frmCustAssist private void button1_Click(object sender, EventArgs e) { bindingSource1.Filter = "LASTNAME like '%" + textBox1.Text + "%'"; bindingSource1.Sort = "LASTNAME"; selected row value .. somwthing like that } in a frmDataEntry selected value custID =textboxCustID selected value custname = textboxCustName

    R 1 Reply Last reply
    0
    • C crisjala

      hi i have a form name frmDataEntry with textboxCustID and textboxCustName and lookup form name frmCustAssist with texboxFilter, button Filter and datagridview then when i double click textboxCustID then frmCustAssist will show i have to look if customer already exist or not then if already exist i hav to get the value of row index ..then the custID and custName of that value selected will be fill in the formDataEntry in textboxCustID and textboxCustName how do code that that plz help my code is here.. in a frmCustAssist private void button1_Click(object sender, EventArgs e) { bindingSource1.Filter = "LASTNAME like '%" + textBox1.Text + "%'"; bindingSource1.Sort = "LASTNAME"; selected row value .. somwthing like that } in a frmDataEntry selected value custID =textboxCustID selected value custname = textboxCustName

      R Offline
      R Offline
      Reza Shojaee
      wrote on last edited by
      #2

      Hi You shall insert a column to your datagridview with type of button(for example). you can set caption of button as "Select". So use the CellContentClick event and in the body of this event for getting data of row that user clicked on the button of same row use below code : dataGridView1.Rows[e.RowIndex].Cells[i].Value.ToString();

      Best Regards, Reza Shojaee

      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