i should get the items in a list thats y i wrote this code but i m getting error and dont understood what is the problem?
List<OrderDetail> objOrderDetail = new List<OrderDetail>();
//Todo get all the grid order
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
});
}