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

[Solved] Selection of row in radgrid

1 Answer 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nagendra d
Top achievements
Rank 1
nagendra d asked on 28 Nov 2009, 02:52 PM
Hi,

   I have a radgrid which will be filled on the page_load method of my page. On selection of the row in radgrid some controls are filled
on my page at client side using OnRowSeleted event.
here,I need to default the row selection to first row and need to call the OnrowSelected event explicity to fill my controls.
I got succeded on selecting the first row by default using RadGrid1.MasterTableView.Items[0].Selected = true;
But,
My OnRowSeleted client side event is not fired, So i was not able to Load the controls according to my default row selection.
Please guide me on this senario.

Thanks,
Nagendra

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 30 Nov 2009, 09:52 AM
Hello Nagendra,

You could select the first item on client-side pageLoad event:
function pageLoad()
{
    var masterTable = $find('<%= RadGrid1.ClientID %>').get_masterTableView();
    if (masterTable.get_selectedItems().length == 0)
        masterTable.selectItem(0);
}

This way, the ItemSelected event will be triggered.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
nagendra d
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or