Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a grid view and a Label inside it which contains the loan. How can i get the value, I tried this but not working:

C#
double loan = double.Parse(GridView1.Rows[0].Cells[4].Text);


Thanks in advanse!!
Posted

 
Share this answer
 
Comments
Monjurul Habib 4-Dec-11 6:16am    
my 5! for the link
Abhinav S 4-Dec-11 6:19am    
Thank you.
Try the below codes:

C#
Label lbl;
foreach(GridViewRow row in GridView1.Rows)
{
   lbl = (Label)row.Cells[4].FindControl("labelname");
   double amount = double.Parse(lbl.Text);
   // process result here
}


Regards,
Eduard
 
Share this answer
 
Comments
Aja wakim 4-Dec-11 4:27am    
got it thanks!

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