如何设置"插入新行"在DataGridView的第一行 [英] How to set the "insert new row" as first row in DataGridView

查看:210
本文介绍了如何设置"插入新行"在DataGridView的第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得在DataGridView呈现插入新行行作为网格而不是最后一排的第一行。我该如何去这样做,它甚至有可能在控制?

I am trying to get the DataGridView to render the "insert new row" row as the first row in the grid instead of the last row. How do I go about doing that, is it even possible in the control?

推荐答案

我不认为有任何方式的新行一行移动到数据网格的顶端。

I don't think there is any way to move the "new row" row to the top of the data grid.

但是,如果你留下的最上面一排空的,因为填充招行跌合适的数据?换句话说,让自己的新行行,这是在网格只是第一行,并添加编辑时,上述新的空白行结束。

But, what if you left the top row empty and as the data filled in move the row down as appropriate? In other words, make your own "new row" row, which is just first row in the grid and add new blank rows above when editing is over.

   Dim myrow = existingDataTable.NewRow

    existingDataTable.Rows.Add(myrow)

    adp.Fill(existingDataTable)
    With DataGridView1
        .DataSource =existingDataTable
    End With    

这篇关于如何设置"插入新行"在DataGridView的第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆