Click here to Skip to main content
15,877,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to compare the values of textbox and gridview.
Posted
Comments
Manas Bhardwaj 6-Jul-12 5:46am    
This is not a good question. What have you tried so far?
durga.r 6-Jul-12 6:31am    
u can't understand my question means thats not my fault
OriginalGriff 6-Jul-12 6:49am    
Maybe, may be not. But it doesn't help you to get an accurate answer to your problem.
The better the question, the better the answer. Help us to help you!
"Fault" is not involved here! :laugh:
OriginalGriff 6-Jul-12 5:51am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, read your homework instructions, or read your mind.
The two items are not directly comparable - what are you trying to achieve?
Use the "Improve question" widget to edit your question and provide better information.

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

and if you uesd textBox wiyh in gridView then first find it and compare
value than anater textbox.
C#
 TextBox NameTextBox = (TextBox)fvPerson.FindControl("NameTextBox");
if(NameTextBox .text==rizText.text)
{

//do some code.

}
 
Share this answer
 
DataGridView.Rows[0].Cells["ColumnName"].Value == textBox1.text
 
Share this answer
 
C#
int index;
if (DataGridView.Rows[0].Cells[index].Value == textBox1.text)
{
    //do something
}


Or

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900