I need to GetThe Dynamic Values of Row1 Row2 Row3 Etc.

My Code
enter code here
<script type="text/javascript">
$("document").ready(function(){
$(".addComment").btnAddRow({rowNumColumn:"rowNumber"});
$(".delRow").btnDelRow();

});
</script>

<table border="1" class="autoTable">

<tr><td>Your Name</td>
<td>Your Age</td><td> </td>
</tr>
<tr><td>
<input type="text" id="wonder" size="25"/>
</td>
<td><input type="text" id="good" size="25"/>
</td>
<td><input type="button" value="Delete" class="delRow"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input type="button" value="submit"/>
</td>
<td>
</td>

</tr>
</table>
Here I get Dynamic Column of Age and Name While clicking addbutton,How to extract the Age value & name for the all dynamic Rows Any Idea?

I tried the following

$(".addComment").btnAddRow({rowNumColumn:"rowNumber"});
$(".delRow").btnDelRow(function(row){
if(row) var a=$("input#good").val(); alert(a) });
It will Give the First Row Value; and Regarding secondRow it alerts null
Any Ideam

Recommended Answers

All 3 Replies


Hi use can use this code. May be it will work.

for (int rows = 0; rows <= GridView1.Rows.Count - 1;rows++ )   
           {   
               for (int cells=0;cells<=GridView1.Rows[rows].Cells.Count-1;cells++)   
               {   
                   //Get text of each cell like the following and process it   
                   string s = GridView1.Rows[rows].Cells[cells].Text;   
               }   
                  
           }  

 for (int rows = 0; rows <= GridView1.Rows.Count - 1;rows++ )
            {
                for (int cells=0;cells<=GridView1.Rows[rows].Cells.Count-1;cells++)
                {
                    //Get text of each cell like the following and process it
                    string s = GridView1.Rows[rows].Cells[cells].Text;
                }
                
            }


Hi you can use this code. May be it will work.

for (int rows = 0; rows <= GridView1.Rows.Count - 1;rows++ )   
           {   
               for (int cells=0;cells<=GridView1.Rows[rows].Cells.Count-1;cells++)   
               {   
                   //Get text of each cell like the following and process it   
                   string s = GridView1.Rows[rows].Cells[cells].Text;   
               }   
                  
           }  

 for (int rows = 0; rows <= GridView1.Rows.Count - 1;rows++ )
            {
                for (int cells=0;cells<=GridView1.Rows[rows].Cells.Count-1;cells++)
                {
                    //Get text of each cell like the following and process it
                    string s = GridView1.Rows[rows].Cells[cells].Text;
                }
                
            }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.