How to add new records to the top of the DataGrid

D

dbuchanan

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
 
N

Nassos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top