Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello To All,


I use the Dynamic Gridview to create Row when page load. there is a button to add new row on grid dynamically.

i want to do that "How to compare the Each Row Textbox value with the next textbox value. I do not add the same Textbox value in next Row.

so, how can i do this ?

i use Template FIeld for binding the Data.

Please help me to solve out this.........

Thanks and Regards...
Mitesh
Posted
Comments
AshishChaudha 16-Oct-12 4:37am    
Mitesh have you tried anything from yourself??

To access textbox inside gridview use
if(
((TextBox)(gridview1.Rows(0).Cells[2].FindControl("textboxid1"))).Text==
((TextBox)(gridview1.Rows(0).Cells[2].FindControl("textboxid2"))).Text;)

Remember: To access dynamically created gridview you should load the grid once again before accesing it
 
Share this answer
 
Comments
[no name] 16-Oct-12 6:39am    
Dear i have one id for the textbox. so, how can i do this ?
then
modify it as
((TextBox)(gridview1.Rows(0).Cells[2].FindControl("textboxid1"))).Text==
((TextBox)(gridview1.Rows(1).Cells[2].FindControl("textboxid1"))).Text;)

i mean to say compare for succesive rows...
 
Share this answer
 
Comments
[no name] 16-Oct-12 7:25am    
where i written this
Divya RS 16-Oct-12 7:26am    
in the add new row event

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