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

Row click on Client if only one row in RadGrid

3 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 20 Feb 2014, 03:28 AM
I have a RadGrid and I want to trigger the OnRowSelected ClientEvent if ther is only one row in the result set after the client side grid data bind.
The following code was working before upgrading to version 2013.3.1324.45

    var resultTable = $('div[id$=RadGrid1]').find('tbody');
    var hasSingleRecord = $('tr', resultTable).length == 2;
    if (hasSingleRecord) {
        resultTable.find('tr:last').click();
    }

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 20 Feb 2014, 09:11 AM
Hello,

var hasSingleRecord = $('div[id$=RadGrid1] .rgMasterTable tbody .rgRow').parent().find('tr').length == 1;
if (hasSingleRecord) {
    $('div[id$=RadGrid1] .rgMasterTable tbody .rgRow').parent().find('tr:last').click();
}


Thanks,
Jayesh Goyani
0
David
Top achievements
Rank 1
answered on 20 Feb 2014, 08:09 PM
the length == 2 is because I have a header in the grid.
It looks look it's the .click() even that is not firing.
0
Jayesh Goyani
Top achievements
Rank 2
answered on 21 Feb 2014, 11:15 AM
Hello,

Please check the attached files.

I am not able to reproduce this issue.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
David
Top achievements
Rank 1
Share this question
or