C#的Dev中GridControl_gridview选中一行删除与读取数据

C#的Dev中GridControl_gridview选中一行删除与读取数据

1.获取GridControl工具选中一行数据的写法1

//GridView:对应GridControl工具中GridView修改名字
int handle = gridView_equ_relation.FocusedRowHandle;
if (handle >= 0)
{
DataRow list = gridView_equ_relation.GetDataRow(handle);
}
2.选中删除选定行

int selected_row_index = gridView_equ_relation.FocusedRowHandle;
gridView_equ_relation.DeleteRow(selected_row_index);
3..获取GridControl工具选中一行数据的写法2

//GridView:对应GridControl工具中GridView的修改名字
int[] intArray= gridView_equ_relation.GetSelectedRows();
if (Otherrow.Length > 0)
{
DataRow Otherrows = ((DataRowView)gridView_equ_relation.GetRow(Otherrow[0])).Row;

————————————————
版权声明:本文为CSDN博主「txwtech」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/txwtech/article/details/129834827

posted @ 2023-03-29 13:20  txwtech  阅读(673)  评论(0编辑  收藏  举报