DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Help with .NET DataGrid features

  1. #1
    Join Date
    Oct 2005
    Posts
    95

    Help with .NET DataGrid features

    Hi

    I like to have some help with VB.NET data grid . I have a data grid where user can put information and save to the SQL Server database . User can pull the saved the data out of database into data Grid . User can add a new row in the database or delete one row . I want user to able to delete a row in the middle of the datagrid and able to save it back to the database . When a user retrive the data from the database into the datagrid the row that is been delete will be blank ( right now if you delete a row next row go up ) .Also when I like to know how a user will able to add a new row in the middle of the datagrid ( right now if a user add a new row to the datagrid it adds on the top of the datagrid or at the bottom of the datagrid ) and able to save it back to the database . Next time when the user retrive the information from the dababase to the datagrid he / she will see the newly added row at the position it was added to in the data grid . Please help

  2. #2
    Join Date
    Dec 2004
    Posts
    163
    Hi,

    I can't see any way that a row that has been deleted from the database is going to be able to show up later as a blank row in the datagrid.

    The only approach that might come close would be to mark the row as deleted using an extra "Deleted" column in the table. However, that is going to lead to all kinds of code changes to manage "deleted" rows.


    The only way to get the data to display in a different order in the datagrid is to sort the data when you retrieve it or sort it using a view. Newly added rows are not going to be able to magically show up in some other position in the grid.

    Kerry Moorman

  3. #3
    Join Date
    Nov 2008
    Location
    pakistan
    Posts
    1

    DevX Developer Forums

    If you scroll to the bottom of the datagrid using the down arrows in the datagrid it properly scrolls to the bottom and displays the data. However, if you hold the left mouse button, scroll the slider to the bottom, and do not release the mouse button as soon as it reaches the bottom of the slider, the second column in the datagrid repeats over and over about 10x. After the mouse button is released, the data remains. The way to clear the repeated fields is to scroll back up using the up arrow then scroll back down using the down arrow, the data then returns to normal.

  4. #4
    Join Date
    Sep 2008
    Posts
    86
    Quote Originally Posted by Energy Recruitm View Post
    If you scroll to the bottom of the datagrid using the down arrows in the datagrid it properly scrolls to the bottom and displays the data. However, if you hold the left mouse button, scroll the slider to the bottom, and do not release the mouse button as soon as it reaches the bottom of the slider, the second column in the datagrid repeats over and over about 10x. After the mouse button is released, the data remains. The way to clear the repeated fields is to scroll back up using the up arrow then scroll back down using the down arrow, the data then returns to normal.
    considering this was almost 3 years ago, I feel sure he has figured it out by now.

  5. #5
    Join Date
    Jan 2009
    Location
    usa
    Posts
    1

    Help with .NET DataGrid features

    Assuming that a table called superheroes exists in your local MS-SQL database, here is the output you should see. After importing the required .NET libraries for accessing a MS-SQL database, the custom BindMe() function is invoked on page load. This function uses the SqlDataReader object to retrieve the data from the superheroes table. And the rest is routine: Assign the DataReader object as the data source of the DataGrid object, and bind the two with a call to the DataBind() method, as shown earlier.The result of the script above is a rendering of the contents of the database table in neat little rows and columns. Notice the amount of code required to generate this output: zero, if you exclude the bits required to authenticate against the database. Using a DataGrid can thus save you significant time and effort when all you need is a quick-and-dirty way of rendering the records in a database result set,

Similar Threads

  1. yag's status report - April 18, 2002
    By Yair Alan Griver [MS] in forum vb.announcements
    Replies: 2
    Last Post: 05-09-2002, 09:20 PM
  2. Yag's status report - Jan 31, 2002
    By Yair Alan Griver [MSFT] in forum .NET
    Replies: 31
    Last Post: 02-11-2002, 10:50 PM
  3. Replies: 0
    Last Post: 11-19-2001, 06:08 PM
  4. ANN: The XtraGrid Suite & XtraEditors Library - 100% Native .NET Components
    By Developer Express in forum dotnet.announcements
    Replies: 0
    Last Post: 10-06-2001, 02:43 PM
  5. Is .NET lacking MFC features???
    By Paul Wardle in forum .NET
    Replies: 12
    Last Post: 08-30-2001, 07:00 PM

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