小编Isy*_*run的帖子

C#检查datagridview列是否为空

我想检查datagridview中的"many"列是否为空.

我的代码

        for (int i = 0; i < (gridx.Rows.Count - 1); i++)
        {
            col = gridx.Rows[i].Cells["code"].Value.ToString();
            col4 = gridx.Rows[i].Cells["many"].Value.ToString();                
        }

        if (col4 == "")
        {
            MessageBox.Show("Many is empty");
            this.Focus();
            return;
        } 
        else
        {
          //my code in here
        }
Run Code Online (Sandbox Code Playgroud)

但它没有显示错误"很多是空的"

请帮帮我..谢谢之前

c# datagridview

-1
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

datagridview ×1