Find Row ID of a Selected Row in JqGrid.

With the help of this code snippet,we can get the row id of the selected row of a jqgrid.
 
//Assign the grid to a variable. 
var myGrid = $('#grdCSCData'),
 //Get the rowid
selRowId = myGrid.jqGrid('getGridParam', 'selrow'),