江湖救急~~~~~~~~! string cInv = ((LinkButton)dgi.Cells[3].Controls[0]).Text.ToString();请问上面的这句话那里有问题啊??我开始用的时候都是好好的,现在怎么也取不到那个值了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的dgi第四列中的第一个控件是一个LinkButton 吗? 我的代码如下:foreach(DataGridItem dgi in dgiDetail.Items){if(((CheckBox)dgi.Cells[16].FindControl("ck")).Checked){ string bill = dgi.Cells[0].Text.ToString();string order = dgi.Cells[1].Text.ToString();string bo = bill.ToString() + "-" + order.ToString();//取物资大类编码和物资税率 string cInv = ((LinkButton)dgi.Cells[3].FindControl("0")).Text.ToString();}} 我遇到过和你一样的问题建议 这样看看string cInv = ((LinkButton)dgi.Cells[3].FindControl("你的LinkButton的id")).Text.ToString(); 如果你的代码没有出错,那么除非LinkButton的Text是空字符串,否则不应该取不到值,你可以设个断点调试看看cInv是什么值。 menu 【疑惑】GridView双击传多个值的问题? C#软件测试 请获取表格内的特定数据的正则表达式,格式如下 分不多了,但也请进来看下,谢谢~!! 两个小问题?请教了. 页面内容导入excel? 关于随机数的问题 关于刷卡机的问题!!! easyui不付费能否在公司的项目中使用 破坏现有框架跳转 验证码程序中能取到值放到session里,在主页面调用后为什么取不到?
foreach(DataGridItem dgi in dgiDetail.Items)
{
if(((CheckBox)dgi.Cells[16].FindControl("ck")).Checked)
{
string bill = dgi.Cells[0].Text.ToString();
string order = dgi.Cells[1].Text.ToString();
string bo = bill.ToString() + "-" + order.ToString();//取物资大类编码和物资税率
string cInv = ((LinkButton)dgi.Cells[3].FindControl("0")).Text.ToString();
}
}
string cInv = ((LinkButton)dgi.Cells[3].FindControl("你的LinkButton的id")).Text.ToString();