How to get focused control ID in C# web application

2 posts, 0 answers
  1. Raj
    Raj avatar
    33 posts
    Member since:
    Jan 2012

    Posted 28 Aug 2015 Link to this post

    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


  2. Eyup
    Eyup avatar
    2941 posts

    Posted 02 Sep 2015 Link to this post

    Hello Raj,

    You can implement AJAX in this scenario:

    And make avail of the OnRequestStart event handler:

    Within the event you can keep the id of the focused input using a HiddenField:

    And using OnResponseEnd event handler you can set the focus back after the AJAX request initiated by the Timer is complete:

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

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top