迭代通过DataGridViewRow列 [英] Iterating through DataGridViewRow columns

查看:148
本文介绍了迭代通过DataGridViewRow列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何遍历 DataGridViewRow 列?我只想得到我的列数,并通过它们获取值。

How can I iterate through DataGridViewRow columns? I just want to get the number of columns that I have and go through them and get the values.

推荐答案

可以使用单元格属性获取所有值行

You can use Cells property to get all values row have

foreach(DataGridViewCell cell in row.Cells)
{
    get value by    cell.Value
}

和列数等于单元格数

这篇关于迭代通过DataGridViewRow列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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