-
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
-
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
-
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.
-
 Originally Posted by Energy Recruitm
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.
-
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
-
By Yair Alan Griver [MS] in forum vb.announcements
Replies: 2
Last Post: 05-09-2002, 09:20 PM
-
By Yair Alan Griver [MSFT] in forum .NET
Replies: 31
Last Post: 02-11-2002, 10:50 PM
-
By AutomatedQA in forum dotnet.announcements
Replies: 0
Last Post: 11-19-2001, 06:08 PM
-
By Developer Express in forum dotnet.announcements
Replies: 0
Last Post: 10-06-2001, 02:43 PM
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|