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

Looping through the rows of a grid on the client side

1 Answer 315 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brendan Vogt
Top achievements
Rank 1
Brendan Vogt asked on 08 Oct 2008, 02:00 PM
Hi,

I am using RadControls Q1 2007 for ASP.NET.

I have a grid with checkboxes that were created manually.  I can't seem to find code which lets me loop through each row, and getting the value of the checkbox.  I need to do this one th client side.

Please can someone advise?

Brendan

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Oct 2008, 05:14 AM
Hi Brendan,

You can loop through each row of a Grid on the client side as shown beow.


ASPX:
<asp:CheckBox ID="CheckBox1" runat="server" onclick="OnClientClick()" /> 
         

JS:
  function OnClientClick()  
     {  
      var Grid = $find("<%= RadGrid1.ClientID %>");  
      var MasterTable=Grid.get_masterTableView();  
        
      for(var i=0;i< MasterTable.get_dataItems().length;i++)  
       {  
          var row = MasterTable.get_dataItems()[i];      
          
      }  
        
     }  


Thanks
Shinu.
Tags
Grid
Asked by
Brendan Vogt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or