Leee

Is there a way to use a standard datagridview control, and rather than having the user add new data via the bottom row, have the same "insertion row" at the top of the datagridview

I am working on a project where the particular datagridview is very full of data, sorted with the newest item at the top. It would make more sense to have new items inserted at the top rather than the bottom.

It seems like this would be a common request...

Thanks for any advice.






Re: Visual Basic Express Edition Inserting new rows at the TOP of a datagridview control?

Paul Domag

Hi,

I suggest on creating a field to store the "date the record was inserted" and sort based on that in a dataview and just re-bind the datagriview anytime there is a new data added to the datatable.

But if what you mean is the method in which to add a new record in the DataGridView UI then, you'll have to do that yourself. You can either inherit the control and extend it (way too nasty) or you can just plainly insert textboxes on the upper space of the control.

cheers,

Paul June A. Domag






Re: Visual Basic Express Edition Inserting new rows at the TOP of a datagridview control?

nbrege

I just recently had to do the same thing. Here's what I did:

1) Just add the row to the end of your DGV like normal

2) Store the row in a variable

3) Remove the row

4) Insert the row at index 0

I'm not sure if this is the best way but it works fine for me...





Re: Visual Basic Express Edition Inserting new rows at the TOP of a datagridview control?

js06

Nbrege,

would you mind posting some code for this

Thanks