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 delete datarow from datatable according to the gridview's checkbox?

How to delete datarow from datatable according to the gridview's checkbox?

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

    Hi all, In my case, i am getting the datatable(dt1) and then bind to gridview (gv1). And in the gv1 i am already add the TemplateField(checkbox) for each rows. My question is how can i delete the datarow according the checkbox(if checked) in the gv1 ? any helps are welcome. regards cocoonwls

    H 1 Reply Last reply
    0
    • C cocoonwls

      Hi all, In my case, i am getting the datatable(dt1) and then bind to gridview (gv1). And in the gv1 i am already add the TemplateField(checkbox) for each rows. My question is how can i delete the datarow according the checkbox(if checked) in the gv1 ? any helps are welcome. regards cocoonwls

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      Assuming that you are actually using a DataGridView. Iterate over the Rows collection, and delete those that have the CheckBox checked.

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      C 1 Reply Last reply
      0
      • H Henry Minute

        Assuming that you are actually using a DataGridView. Iterate over the Rows collection, and delete those that have the CheckBox checked.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        C Offline
        C Offline
        cocoonwls
        wrote on last edited by
        #3

        Thanks,i got it~

        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