获取网格视图控件 [英] get grid view control

查看:53
本文介绍了获取网格视图控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个网格视图和其中包含贷款的标签.我如何获得价值,我尝试了一下但没用:

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:

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





Thanks in advanse!!

推荐答案

代码项目-常见问题系列1:ASP.Net GridView [ ^ ]应该可以帮助您.
Code Project - Frequently Asked Questions Series 1: The ASP.Net GridView[^] should help you out.


尝试以下代码:

Try the below codes:

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


这篇关于获取网格视图控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆