如何比较textbox和gridview的值. [英] how to compare the values of textbox and gridview.

查看:68
本文介绍了如何比较textbox和gridview的值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何比较文本框和gridview的值.

how to compare the values of textbox and gridview.

推荐答案

int index;
if (DataGridView.Rows[0].Cells[index].Value == textBox1.text)
{
    //do something
}







Or

if (DataGridView.Rows[0].Cells["ColumnName"].Value == textBox1.text)
{
    //do something
}


DataGridView.Rows [0] .Cells ["ColumnName"].Value == textBox1.text
DataGridView.Rows[0].Cells["ColumnName"].Value == textBox1.text


if (DataGridView.Rows[0].Cells["Rizwan"].Value == textBox1.text)
{
    //do something
}


如果您在gridView中使用textBox wiyh,则首先找到它并进行比较
值大于anater文本框.


and if you uesd textBox wiyh in gridView then first find it and compare
value than anater textbox.

 TextBox NameTextBox = (TextBox)fvPerson.FindControl("NameTextBox");
if(NameTextBox .text==rizText.text)
{

//do some code.

}


这篇关于如何比较textbox和gridview的值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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