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. Need Help in DatagridView

Need Help in DatagridView

Scheduled Pinned Locked Moved C#
help
5 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.
  • R Offline
    R Offline
    Rahul DSG
    wrote on last edited by
    #1

    Hello Friends.. I am using a datagridview which have a checkbox column.there is a delete button on the form.i want that when i click the delete button and none of the check box is checked(true). it will simply display a message that "Firrst select a row".

    M 1 Reply Last reply
    0
    • R Rahul DSG

      Hello Friends.. I am using a datagridview which have a checkbox column.there is a delete button on the form.i want that when i click the delete button and none of the check box is checked(true). it will simply display a message that "Firrst select a row".

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Loop through each row in the datagridview and check for the ones where the value of the cell with the checkbox == true. If there are none then be rude to the user and ask him/her to check 1 or more item.

      Never underestimate the power of human stupidity RAH

      R 1 Reply Last reply
      0
      • M Mycroft Holmes

        Loop through each row in the datagridview and check for the ones where the value of the cell with the checkbox == true. If there are none then be rude to the user and ask him/her to check 1 or more item.

        Never underestimate the power of human stupidity RAH

        R Offline
        R Offline
        Rahul DSG
        wrote on last edited by
        #3

        suppose there are 20 rows and one is checked and i put the code (checkbox=true)with in the loop then 19 times it display "Please Select a Row". and i think its not good.

        M 1 Reply Last reply
        0
        • R Rahul DSG

          suppose there are 20 rows and one is checked and i put the code (checkbox=true)with in the loop then 19 times it display "Please Select a Row". and i think its not good.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Thinking is not one of your strong suits is it. Loop the data rows count the checked items ask for confirmation to delete n# items checked OR call the user an idiot and ask them to check 1 or more item. If you can't work these things out you are really going to struggle as a developer!

          Never underestimate the power of human stupidity RAH

          R 1 Reply Last reply
          0
          • M Mycroft Holmes

            Thinking is not one of your strong suits is it. Loop the data rows count the checked items ask for confirmation to delete n# items checked OR call the user an idiot and ask them to check 1 or more item. If you can't work these things out you are really going to struggle as a developer!

            Never underestimate the power of human stupidity RAH

            R Offline
            R Offline
            Rahul DSG
            wrote on last edited by
            #5

            ok ok now i understand... i am a fresher,i have no idea about that...

            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