This is a migrated thread and some comments may be shown as answers.

How to get focused control ID in C# web application

1 Answer 259 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 28 Aug 2015, 09:31 AM

hi friends,

i have editable radgrid, where all the fileds is in open state. it contains textbox and label.

user can enter value in any textbox in the grid.

mean while, i am refreshing the grid using timer at regular interval.

my issue is, after refresh, the cursor is disappears from the control.

 

i need to set focus to the same control,where the cursor before postba​ck.

it is possible to take focused control id in server side using C# web application.

it possible, give me some ideas.

 

Thanks in advance

ASRK.....

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 Sep 2015, 06:22 AM
Hello Raj,

You can implement AJAX in this scenario:
http://demos.telerik.com/aspnet-ajax/ajaxmanager/application-scenarios/ajaxify-timer/defaultcs.aspx

And make avail of the OnRequestStart event handler:
http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/client-side-programming/events/onrequeststart

Within the event you can keep the id of the focused input using a HiddenField:
https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hiddenfield%28v=vs.90%29.aspx

And using OnResponseEnd event handler you can set the focus back after the AJAX request initiated by the Timer is complete:
http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/client-side-programming/events/onresponseend

Hope this helps. I can also prepare a sample RadGrid web site if you prefer.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or