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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Remove One Row from DataGridView [modified]

Remove One Row from DataGridView [modified]

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 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.
  • M Offline
    M Offline
    M Riaz Bashir
    wrote on last edited by
    #1

    Hi, I have 5 rows in my datagridview1. but how to remove any particular row? when I use => "dataGridview1.Rows.RemoveAt(4)" then error comes "Uncommited new row cannot be deleted". :( Thank you in advance -- modified at 3:22 Wednesday 19th September, 2007

    S R 2 Replies Last reply
    0
    • M M Riaz Bashir

      Hi, I have 5 rows in my datagridview1. but how to remove any particular row? when I use => "dataGridview1.Rows.RemoveAt(4)" then error comes "Uncommited new row cannot be deleted". :( Thank you in advance -- modified at 3:22 Wednesday 19th September, 2007

      S Offline
      S Offline
      sri_ashutosh
      wrote on last edited by
      #2

      hello dear, try it string dgvstr=""; SqlDataAdapter da = new SqlDataAdapter("select (enter all columan_name in table) from table_name", con); dgvstr = da.SelectCommand.CommandText.Replace(",enter remove columan_name", ""); DataSet ds = new DataSet(); da.Fill(ds, "table_name"); datagridview.DataSource = ds.Tables[0]; datagridview.Columns[enter remove column_index(ex-0)].Visible = false; datagridview.Rows[0].Selected = true;

      1 Reply Last reply
      0
      • M M Riaz Bashir

        Hi, I have 5 rows in my datagridview1. but how to remove any particular row? when I use => "dataGridview1.Rows.RemoveAt(4)" then error comes "Uncommited new row cannot be deleted". :( Thank you in advance -- modified at 3:22 Wednesday 19th September, 2007

        R Offline
        R Offline
        rohitsrivastava
        wrote on last edited by
        #3

        datagridview1.currentrow.cell(0).value this will work and give the connection

        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