dataGridView从哪个索引开始? [英] What index does dataGridView start at?

查看:49
本文介绍了dataGridView从哪个索引开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

foreach (DataGridViewRow item in this.dataGridView1.SelectedRows)
{
    if (Int32.Parse(item.Cells[1].Value.ToString()) >= Int32.Parse(textBox4.Text) )
    {
        dataGridView1.Rows.RemoveAt(item.Index);
    }
}

我正在尝试检查第二列中的整数是否至少为textBox4中的值.但是,运行此命令时不会删除任何内容,因此我觉得它没有在比较正确的列.

I'm trying to check if the integer in the second column is at least the value in textBox4. However, nothing is removed when I run this, so I feel it's not comparing the right column.

C#列是从0还是从1开始计数?

Do C# columns count from 0 or from 1?

推荐答案

dataGridView的行和列均从0索引开始

dataGridView's both rows and Columns start at 0 index

这篇关于dataGridView从哪个索引开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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