Patrick Rubeski
Posted
on Mar 29, 2010
(permalink)
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.
Atanas Korchev
Atanas Korchev
Posted
on Mar 29, 2010
(permalink)
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.
Patrick Rubeski
Posted
on Mar 29, 2010
(permalink)
is there a way to select this row in a way that actually triggers the OnRowSelected client event?
Answer
Atanas Korchev
Atanas Korchev
Posted
on Mar 30, 2010
(permalink)
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.