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

Preselect last row in Grid

2 Answers 20 Views
GridView
This is a migrated thread and some comments may be shown as answers.
UGH!!
Top achievements
Rank 1
UGH!! asked on 29 Mar 2011, 10:04 PM
Suppose I have a grid. New records are inserted with a modal.  After the insert is complete, how can I highlight or preselect the newest record in the grid? I need the selecteditem to be the newest in the grid.

You would think it's fairly easy, but I don't seem to be able to get it. Like this ...

_grid.SelectedItem = _grid.Items.Count -1

Any help would be appreciated. Thanks very much!!

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 30 Mar 2011, 07:01 AM
Hello UGH!!,

Here is the code:

 _grid.SelectedItem = _grid.Items[_grid.Items.Count -1];

All the best,
Vlad
the Telerik team
0
UGH!!
Top achievements
Rank 1
answered on 30 Mar 2011, 03:41 PM
Awesome! Works great ...
Tags
GridView
Asked by
UGH!!
Top achievements
Rank 1
Answers by
Vlad
Telerik team
UGH!!
Top achievements
Rank 1
Share this question
or