从dataGrid的选定行获取单元格 [英] Getting a cell from the selected row of a dataGrid

查看:82
本文介绍了从dataGrid的选定行获取单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dataGridView表,我想从所选行的第四列中检索单元格.例如,如果我有一个带有以下标题的表:

名,姓,地址

我想选择第十行并检索地址下单元格中的内容.请问有没有简单的方法.

I have a dataGridView table and I want to retrieve the cell from the fourth column of the selected row. For example if I have a table with the following headings:

First Name, Last Name, Address

I want to select the tenth row and retrieve whats in the cell under address. Is there an easy way to do this please.

推荐答案

使用DataGridView的CurrentCell属性吗?
来自MSDN的示例:
this.dataGridView1.CurrentCell = this.dataGridView1[1,0];
Use the DataGridView''s CurrentCell property?
An example from MSDN:
this.dataGridView1.CurrentCell = this.dataGridView1[1,0];


这篇关于从dataGrid的选定行获取单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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