dhriti rao

dhriti rao

  • NA
  • 4
  • 2.5k

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?

Dec 18 2012 4:52 AM
 
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
});
}

Answers (1)