Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how the loop can generate.. help me
Posted
Comments
AshishChaudha 19-Dec-12 6:16am    
What you have tried so far??

1 solution

C#
foreach (GridViewRow gvrow in GridView1.Rows) 
{ 
//Do insert operations here. 
}
 
Share this answer
 
Comments
Dhritirao's 19-Dec-12 6:30am    
foreach (GridViewRow gr in GridView.Rows)
{
objOrderDetail.Add(new OrderDetail
{
Code = int.Parse(((Label)(gr.FindControl("lblcode"))).Text),
Descritpion = ((Label)(gr.FindControl("lbldescription"))).Text,
Rate = int.Parse(((Label)(gr.FindControl("lblrate"))).Text),
Qty = int.Parse(((Label)(gr.FindControl("lblqty"))).Text),
Total = ((Label)(gr.FindControl("lbltotal"))).Text
});

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900