VB.Net Datagridview adding items
Posted on 2011-03-11
I have a datagridview that is constantly having data added to it (read through a serial port), and it has 5 columns. My manager wants the most recent items to be added to the top, not the bottom which is the default way, so that anyone observing can actually see that data is coming in.
The way I am doing this right now is to do a sort on one particular column (date), so the latest shows at the top.
The problem is that when the datagridview has a few thousand rows, and I have to keep doing this sorting, it takes the CPU usage to 100% constantly.
My question is this: is there a way to have it so that when you datagridview.rows.add, for the data to automatically be added to the top of the datagrid, so I don't have to keep doing a sort?