Select row

Jul 9, 2014 at 1:03 PM
How can I set selected row (that it would be highlighted) with javascript or by getting information from controller (in MVC Razor)
Jul 9, 2014 at 2:38 PM
I need to highlight newly added record.
Jul 9, 2014 at 5:56 PM
Edited Jul 9, 2014 at 5:57 PM
Try the following
    //Select the first row as default in the grid
    $(".grid-row:eq(0)").click();
Hope it helps
Jul 10, 2014 at 7:50 AM
ya.. it would be okey if the line would always be first, but I need to highlight the line after edditing it too (it will not be first then)
Jul 10, 2014 at 5:28 PM
Edited Jul 10, 2014 at 5:29 PM
I think this could be help you out..

For Grid mvc latest version
 var grid = $('.grid-mvc').gridmvc();

grid.youGridName.onRowSelect(function (e) {
        onGridRowSelect(e);
    });

function onGridRowSelect(e) {
    var row = e.row;
    alert(row.Name); // this is row property

   alert(row.RollNo); // this is row proerty
}
for grid mvc 2.* use on row select like
pageGrids.youGridName.onRowSelect(function (e) {
        onGridRowSelect(e);
    });
Jul 10, 2014 at 8:17 PM
This would show me selected rows Name/RollNo.

I needed to highlight certain row, which Id's was equal to something.

SO this way is wrong.

Althought I wrote jquery script where i find In table where Id is equal to something and change its style.
Thats all