473,569 Members | 2,352 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 1457
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*********@ho tmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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
1545
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 datagrid. What I want to do is not to create a complete dataset but a partial one, and whenever i reach the end of the partial dataset i want the...
1
1131
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 the cell heights between the one data row and the header row to match the whole datagrid height. Is there any easy way to fix the cell sizes to the...
3
7104
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
6258
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 datagrid When ever click the Next Buttuon Iam getting data from database Total(50,000) Records.Every time performanse wise it is taken lot of
1
1239
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 designer I tell the datagrid to display the child records only from the dataset (Relation called ClientsCases table>cases) it will display the data...
3
5394
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 more than 70 thousand, and it is really slow to get the dataset ready to populate the datagrid. I am sure there are solutions on this issue, but I...
1
1735
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. All other forms (approx 40+) are working fine on production server. That RuleDetail.aspx page has two user controls. The first user control has a...
3
1677
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. This functionality is working nicely and efficiently. I like this because I dont have to grab ALL the records on each trip, just the next or previous...
1
1386
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 it in above thing i want to save new records using datagrid,dataset and dataadpter withought displaying previous ones Some one will tell me...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5222
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.