We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Info on selected row in OnRecordSelectionEvent

I would like to call a client-side Javascript method when a row is selected in the grid, and in the script get information on the contents of the selected row. Can you give me an example of how to do this? Something like:

Script:
function rowSelected()
{}



Grid:

.ClientSideEvents(events =>
{
events.OnRecordSelectionEvent("rowSelected()");
})



1 Reply

SN Sridhar N Syncfusion Team September 23, 2011 04:13 AM UTC

Hi Jim,

Thanks for your interest in Syncfusion products.

Your requirement can be achieved by having parameters(sender,args) in the function. Using args you can get the information of the selected row.Please refer the below code snippet.

[View]

<%=Html.Syncfusion().Grid("GenericListGrid")
.............
.ClientSideEvents(events =>
{
events.OnRecordSelectionEvent("RowSelected");
})
%>



[Javascript]

function RowSelected(sender, args)
{
alert("The Selected Record Title is " + args.record.Title);
}


For your convenience, we have created sample and the same can be downloaded from the following link.

GridMVC-List-927802653.zip

Please let me know if you have any other questions or concerns.

Regards,
Sridhar.N



Loader.
Live Chat Icon For mobile
Up arrow icon