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. Visual Basic
  4. How to clear Datagridview

How to clear Datagridview

Scheduled Pinned Locked Moved Visual Basic
csharptutorial
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.
  • P Offline
    P Offline
    priya_p233
    wrote on last edited by
    #1

    hi all frends, im using datagridview on my form (VB.net(winforns). i am filling datagridview on formload. i have clearAll button, so i want to clear all records of my datagridview whn user clicks on clear button. Plz tell me how to code for it. Thanks & Regards Priya.

    priya

    A 1 Reply Last reply
    0
    • P priya_p233

      hi all frends, im using datagridview on my form (VB.net(winforns). i am filling datagridview on formload. i have clearAll button, so i want to clear all records of my datagridview whn user clicks on clear button. Plz tell me how to code for it. Thanks & Regards Priya.

      priya

      A Offline
      A Offline
      Ali 110
      wrote on last edited by
      #2

      datagridview1.rows.count=0

      I 1 Reply Last reply
      0
      • A Ali 110

        datagridview1.rows.count=0

        I Offline
        I Offline
        IqbalVB
        wrote on last edited by
        #3

        The code will not working because it's read only. By the way, if you use bounded data you can't clear it. But if you use typed data you can clear the collection with this: Private Sub btnClearALL_Click(Byval sender as object, Byval e as System.Eventargs) Handles btnClearAll.Click datagrid1.rows.clear End Sub Exprience is the best teacher

        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