如何在C#中使用行索引和列索引从datagridview获取单元格值? [英] How do I get the cell value from a datagridview using row index and column index in c#?

查看:89
本文介绍了如何在C#中使用行索引和列索引从datagridview获取单元格值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datagridview dgvList 。。然后我想获取特定行和列的单元格值,而不使用selectedRows属性。

I have a datagridview dgvList.. Then I want to get the cell value of a particular row and column, without using the selectedRows property.

ie:

myvalue = dgvList[2nd row][1st column];


推荐答案

尝试一下

myvalue =dgvList.Rows[rowindex].Cells[columnindex].Value.ToString();

这篇关于如何在C#中使用行索引和列索引从datagridview获取单元格值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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