hide all existing rows in datagridview


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: hide all existing rows in datagridview

  1. #1
    Join Date
    Feb 2008
    Posts
    28

    hide all existing rows in datagridview

    Hi,

    How do I hide all rows in datagridview from end users? I need a method to only allow user to add new rows and not edit the rows.

    Please help

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    If you want the datagridview to be empty, then just don't load it and there will be nothing to hide.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Feb 2008
    Posts
    28

    re

    Hi Hack,

    Could you teach me how to not load the data from the table?

    Thanks

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Don't bind it.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Quote Originally Posted by crystalelle
    Hi,

    How do I hide all rows in datagridview from end users? I need a method to only allow user to add new rows and not edit the rows.

    Please help
    I'm assuming your using a dataset. If so you can modify your Select command to return no records (this is SQL server syntax):

    Select Field1, Field2 from Table1 where 1 = 2

    You just need a where clause that will always be false. This will display an empty grid. Your Insert command should still work.

    ...joe

Similar Threads

  1. Hide datagrid rows that has data.
    By crystalelle in forum .NET
    Replies: 6
    Last Post: 03-01-2008, 01:05 PM
  2. Sorting DataGridView & Keeping Rows In a bunch
    By christianbg in forum .NET
    Replies: 1
    Last Post: 02-19-2008, 07:52 PM
  3. DataGridView Returning Values from Cells
    By triley35 in forum .NET
    Replies: 1
    Last Post: 07-08-2006, 12:34 AM
  4. Deleteing rows in a Datagridview
    By filippo.monti in forum .NET
    Replies: 1
    Last Post: 11-28-2005, 03:57 PM
  5. dynamically hiding/showing specific rows
    By syxxzonz in forum Web
    Replies: 2
    Last Post: 06-08-2005, 08:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center