Hi,

I want to ask how to add/insert new row/record and it show at the top in datagridview.

i don't want the new add record at the bottom but i want it at the top.

I mean,the current is at the top in datagridview.

i'm adding the new record is not from inside the datagridview,but from textbox at outside datagridview.

Thank you.

Edited 5 Years Ago by sarifah n: n/a

Hi,

You can try something like this:

Me.DataGridView1.Rows.Insert(0, value1, value2) ' values you entered

Didn't tested it

try something like this

datagridview1.rows.add()

dim row AS integer = datagridview1.rows.count -1 
    while row > 0
       'if you have more cells in the row simple copy and paste the line below and change the cell
        ' number
       datagridview1.rows(row).cell(0).value = datagridview1.rows(row-1).cell(0).value
       datagridview1.rows(row).cell(1).value = datagridview1.rows(row-1).cell(1).value
       row = row -1
     End While

datagridview1.rows(0).cells(0).value = 'whatever you want to add to the first row

hope this helps

This question has already been answered. Start a new discussion instead.