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

RadGrid : how to set focus after sorting?

1 Answer 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephane
Top achievements
Rank 1
Stephane asked on 14 Oct 2012, 03:10 AM

Hello everyone,

I need your help, i have 2 RadGrid which each depend on other grid.
Each grid can sort. But if i sort the first grid i lost the first row selected item and the second grid give me error of grid1 cant be null

So, i would like to know how i can set the focus on the last selected item or just focus on the first row?
I use VB.NET

I have tried sample i found here, and nothing change like 

RadGrid1.MasterTableView.Items(0).Selected = True

for now in my Page_Load to get the focus i use radgrod1.items(0).focus()
but it doesn't work on the SortCommand sub, i get a javascript error message

In this sub, i get a new DataSource and i rebind the radgrid.
I have tried RadGrid1.SelectedIndexes.Add(0) with my .focus and same JS error.

Thanks for your help.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 17 Oct 2012, 09:54 PM
Hi,

Go through the demo linked below and see what is the difference in your case:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx

Greetings,
Pavlina
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
Stephane
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or