Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends,
how can i find the Checkbox control which is inside the Gridview on TextChanged event of Textbox control.....the Checkbox & Textbox both are inside the gridview.
only that i have to find the related checkbox of that row on TextChanged event in that Row.

reply frnds!

Regards,
aamir
Posted
Comments
_Amy 5-Jul-12 7:15am    
You question is not clear. Did you tried anything?

write below code in textchanged event
C#
GridViewRow row=(sender as TextBox).NamingContainer


this property gives you row where this textbox is present.
 
Share this answer
 
yes i have tried on the TextChanged event of the Textbox which is Inside the Gridview control
below is my code:

C#
protected void txtenddate_TextChanged(object sender, EventArgs e)
   {
       try
       {
           TextBox txtEndate = ((TextBox)(sender));
           GridViewRow grv = ((GridViewRow)(txtEndate.NamingContainer));
           CheckBox chkgoing = (CheckBox)GridDetails.Rows[0].FindControl("chkOngoing");

           if (txtEndate.Text != "")
           {
               chkgoing.Enabled = false;
           }
       }
       catch (Exception ex)
       {

       }
   }

but i am not getting the Checkbox whic i have to disable....whenever there is value in the txtEndate textbox


pl reply,
 
Share this answer
 
v2

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