Loop through displayed rows

2 posts, 0 answers
  1. Johnathan
    Johnathan avatar
    40 posts
    Member since:
    Sep 2012

    Posted 01 Nov 2016 Link to this post


    Is there a way to loop through only the displayed rows of a radgrid, preferably on the client-side with javascript?



  2. Patrick
    Patrick avatar
    215 posts

    Posted 02 Nov 2016 Link to this post

    Hello Johnathan,

    One way is get a reference to the masterTableView, get the dataItems, and loop through each item.    In this case, I'm getting the cell under ProductName and the element.

    Here is the JavaScript:
    function Click() {
        var grid = $find("<%=RadGrid1.ClientID %>");
        var masterTable = grid.get_masterTableView()
        var dataItems = masterTable.get_dataItems();
        for (var i = 0; i < dataItems.length; i++) {

    I've attached a project which illustrates this approach.

    Hope this helps!

    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top