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

How to make a row selected/highlighted using javascript?

3 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manishkumar
Top achievements
Rank 1
Manishkumar asked on 25 Feb 2009, 07:29 AM
Hi,

How can I make a row inside the grid selected/highlighted using javascript?

I tried assigning some index to the property sender._selectedIndexes[0] but it doesn't seem to work.

Please guide.

3 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 25 Feb 2009, 08:15 AM
Hello Manishkumar,

Test the following snippet:
<script type="text/javascript" language="javascript"
    function selectFirstItem() 
    { 
        var radGrid = $find('<%= RadGrid1.ClientID %>'); 
        radGrid.get_masterTableView().get_dataItems()[0].set_selected(true); 
    } 
</script> 

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Manishkumar
Top achievements
Rank 1
answered on 25 Feb 2009, 02:07 PM
Thanks a lot.
0
Shinu
Top achievements
Rank 2
answered on 26 Feb 2009, 04:01 AM
Hi Manish,

You can also refer the following help article.
set_selected()

Shinu
Tags
Grid
Asked by
Manishkumar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Manishkumar
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or