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

[Solved] When row is selected the focus goes back to top in radgrid.

3 Answers 205 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raji
Top achievements
Rank 1
Raji asked on 09 Mar 2013, 12:34 AM
Hi,

I have radgrid which has 200 rows per page. I have enabled row selection. When I select a row it gets selected but the focus moves to top of the grid. I want the focus to remain on the selected row. How is this possible?

<

 

ClientSettings AllowKeyboardNavigation="True" EnableRowHoverStyle="true">

 

 

<Selecting AllowRowSelect="True" />

 

 

<ClientEvents OnRowSelected="rowSelected" OnKeyPress="KeyPress" />

 

 

</ClientSettings>

Thanks,
Raji

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 Mar 2013, 12:09 PM
Hi Raji,

One possible approach is to ajaxify your grid. Alternatively, you can scroll to the selected item:
http://www.telerik.com/help/aspnet-ajax/grid-scroll-to-selected-item.html

Hope this helps.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Raji
Top achievements
Rank 1
answered on 13 Mar 2013, 04:29 PM
Do you have the sample for the first option? I tried the second option but I do not want the scroll bars. I did try to set the scrollbar height but when the number of records returned is small then you have a blank space below.
Any help will be appreciated.
Thanks,
Raji
0
Eyup
Telerik team
answered on 15 Mar 2013, 11:19 AM
Hi Raji,

You can use RadAjaxManager or RadAjaxPanel to ajaxify your grid. You can also check out various demos to get a practical idea of its implementation:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

In case you have defaultbutton on your form, please create a defaultfocus hidden button to preserve the scroll position as demonstrated in the following thread:
http://www.telerik.com/community/forums/aspnet-ajax/ajax/usage-of-defaultbutton-logic-is-resulting-in-moving-to-the-top-of-the-page-on-other-control-clicks.aspx

That should do the trick. Please give it a try and let me know if it works for you.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Raji
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Raji
Top achievements
Rank 1
Share this question
or