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

Get grid itemcount with javascript

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darin
Top achievements
Rank 1
Darin asked on 04 Jun 2013, 02:42 PM
When the user closes a radwindow the following javascript function is called to refresh the grid on the parent page:

function refreshGrid(arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }

That works great. I now need javascript to get the itemcount from the grid, after the grid has refreshed, and update a text field on the page.

How can I get the itemcount grid value via javascript?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Jun 2013, 06:01 AM
Hi,

Please use the following code to get the count of the rows.

JAVASCRIPT:
function RowCount()
 {
    var grid = $find("<%=RadGrid1.ClientID %>");
    var MasterTable = grid.get_masterTableView();
    var Rows = MasterTable.get_dataItems();
    alert(Rows.length);
 }

Thanks,
Princy
Tags
Grid
Asked by
Darin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or