473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add new records to the top of the DataGrid

Hello,

I am using Win forms VB 2003

The form design requires the newest records appear at the top of the
DataGrid.

I load my form with a stored procedure that orders the records with the
newest one on top of the DataGrid.

New records are added by the user by filling out the controls on the
form and clicking the 'Add' button. When the new record is added to the
DataGrid it appears at the bottom of all the records.

To put the new record back on top I am embarrassed to say that I added
code to the 'Add' (save) button that goes to the trouble of clearing
the DataGrid, and form and emptying the dataset. Then it reloads the
form.

What is the correct way to get new records to be added to the top of
the datagrid?

Thank you,
dbuchanan

Nov 29 '05 #1
2 1454
thi only way that i know of, is build a new DataSet add the first row you
want and add the rest after and finally assing it to the datasource of the
grid
hope that helps

"dbuchanan" <db*********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello,

I am using Win forms VB 2003

The form design requires the newest records appear at the top of the
DataGrid.

I load my form with a stored procedure that orders the records with the
newest one on top of the DataGrid.

New records are added by the user by filling out the controls on the
form and clicking the 'Add' button. When the new record is added to the
DataGrid it appears at the bottom of all the records.

To put the new record back on top I am embarrassed to say that I added
code to the 'Add' (save) button that goes to the trouble of clearing
the DataGrid, and form and emptying the dataset. Then it reloads the
form.

What is the correct way to get new records to be added to the top of
the datagrid?

Thank you,
dbuchanan

Nov 29 '05 #2
Thank you Nassos.

Anyone else have any ideas.

dbuchanan

Nov 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1535
by: Ioannis Demetriades | last post by:
Hi, I am doing a VB.NET application with SQL Server 2000 and I need to implement a database search facility that will normally return lots of records. Those records will then be displayed in a...
1
1128
by: Charlie Dison | last post by:
I am using a datagrid bound to a Dataset. The problem is when the dataset has fewer records than the page size for the height, the cells grow automatically. Thus the datagrid with one record grows...
3
7096
by: suresh | last post by:
frenz, i need to disable the add new record mode in datarid. i just want to modify the existing records in the grid...but i dont want to add new records..how do i do that? -suresh
4
6256
by: karunakar rao | last post by:
Hi All I need some help. I have been populated 50,000 Records in asp.net C# datagrid. Ever page has 10 records Example "<< Prev 1 2 3 4 5 6 7 8 9 10 Next>> Iam showing like that in my...
1
1232
by: jwogick | last post by:
I'm hoping someone can help me! I just have a simple form with a datagrid displaying child records from a dataset that contains two related tables Parent table>Clients Child table>cases. using the...
3
5390
by: Kai Zhang | last post by:
I am trying to display some database records in datagrid using dataset. the records need to be displayed are couple of thousands, but the records in database that the SQL query needs to exam are...
1
1732
by: syedrafey | last post by:
Hello, One of datagrid on my aspx page is not showing records on production server while there are records in database table. I have tested that page on my local machine and it is working fine....
3
1673
by: dbarker1 | last post by:
Hello All, I am developing a web front end using the standard datagrid in the 1.1 framework. Currently it allows users to navigate through records 20 at a time via previous and next buttons. ...
1
1380
by: sushant2009 | last post by:
Hi , I want to display empty databae table(actually table contains lot of records) to datagrid using dataset and dataadpter. After displaying i will fill new records in datagrid and i will save...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.