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

[Solved] client side row select

3 Answers 222 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Patrick Rubeski
Top achievements
Rank 1
Patrick Rubeski asked on 29 Mar 2010, 02:22 PM
I'm looking for a way to select a row in the grid via client side code.  I am trying to select the first row in the grid each time the page loads. Does anyone know of way to do this?  I've been searching the posts for awhile now and haven't found anything related.
Thanks in advance for any info.

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 29 Mar 2010, 03:37 PM
Hi Patrick Rubeski,

If you need to show the first row as selected you can do this:


.ClientEvents(events => events.OnLoad("onLoad"))


<script type="text/javascript">
    function onLoad() {
        $('#Grid tr:has(td):first').addClass('t-state-selected');
    }
</script>

Kind regards,
Atanas Korchev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Patrick Rubeski
Top achievements
Rank 1
answered on 29 Mar 2010, 08:13 PM
is there a way to select this row in a way that actually triggers the OnRowSelected client event?
0
Accepted
Atanas Korchev
Telerik team
answered on 30 Mar 2010, 09:01 AM
Hello Patrick Rubeski,

Try this

$('#Grid tbody tr:has(td):first').click()

Regards,
Atanas Korchev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Patrick Rubeski
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Patrick Rubeski
Top achievements
Rank 1
Share this question
or