Click here to Skip to main content
16,013,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have web application...one page item stock have gridview who have 3 textbox...
when i insert value of 1st textbox it calulates the value of textbox 2 and 3....calculation function i put on textbox1 text change event....

My problem is that when textbox1 autopost back value is true that time textchang event call bt it lost focus...after inserting value of textbox1 i want to focus on textbox2...

if i textbox1 autopostback value false then my textchanged event not called...give me solution...
Posted

1 solution

Use UIElement.Focus Method[^].

Inside TextChanged Event of textbox1, set focus on textbox2 like...
C#
textbox2.Focus();
 
Share this answer
 
Comments
kavita painter 27-Dec-13 5:32am    
but because of auto post back true the page is post back and loist the focus...
So, after Page Load, it will come to TextChanged Event and do the Focus.
Have you tried setting Focus in TextChanged Event? Is it not working?
kavita painter 27-Dec-13 7:22am    
yes i get..thanks...
Glad to hear that. Good work. :)

Please accept this answer, if it has helped you in any way.
This will help others to find the answer in one go and you will also be awarded with some points for this action...

Thanks,
Tadit

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