如何删除vb.net中未绑定数据表中的最后一行 [英] how to delete the last row in an unbound datatable in vb.net

查看:66
本文介绍了如何删除vb.net中未绑定数据表中的最后一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用数据网格视图控件,我需要执行以下操作,删除数据网格中的最后一行,并将最后一行设为当前行。



现在,下面是如何处理数据网格。



1.将数据行加载到数据网格我所做的是以编程方式使用列和行声明或创建数据表,这个数据表依次加载数据或将数据插入到分层数据网格视图控件中,现在我正在考虑如果用户希望删除最后一行(可能是由于错误),或者希望从数据网格视图中删除行,按照从下到上的顺序(将操作放在数据表上,该数据表在数据网格视图或数据网格视图上加载数据,以及如何(代码)我这样做了。)



2.在数据网格视图中插入数据后我发现第一行被突出显示为当前行,如何更改这样最后一行数据就是当前的r ow。



问候



ade

Hi all,
I am working with a datagrid view control , and i need to do the following, delete the last row in the datagrid and make the last row the current row.

Now below is how a work with the datagrid.

1. To load rows of data on to the datagrid what i did was to declare or create a datatable programmatically with columns and row, this datatable in turn loads data or insert data onto the hierarchical datagrid view control, row by row, now i am thinking what if the user wishes to remove the last row (maybe due to error), or wishes to remove rows from the datagrid view, in this order "bottom to top" (will the action be on the datatable that loads data on the datagrid view or on the datagrid view, and how (code) do i do it).

2. After inserting rows of data onto the datagrid view i discovered that the first row is highlighted as current row, how do change this so that the last row of data is the current row.

regards

ade

推荐答案

1)看看这里:

DataGridView.DataSource属性 [ ^ ]



2)使用:

DataGridView.RowCount属性 [ ^ ]

DataGridView.SelectionChanged事件 [ ^ ]





更多:

如何:在Windows窗体DataGridView控件中获取和设置当前单元格 [ ^ ]
1) Have a look here:
DataGridView.DataSource Property [^]

2) Use:
DataGridView.RowCount Property [^]
DataGridView.SelectionChanged Event[^]


More:
How to: Get and Set the Current Cell in the Windows Forms DataGridView Control[^]

这篇关于如何删除vb.net中未绑定数据表中的最后一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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