GridViewColumn组装错误 [英] GridViewColumn assembly error

查看:68
本文介绍了GridViewColumn组装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的CS代码中,我有2个foreach循环,分别用于GridViewRow和GridViewColumn
我正在使用System.Web.UI.WebControls namespace.for GridViewColumn出现错误,错误为错误3找不到类型或名称空间名称"GridViewColumn"(您是否缺少using指令或程序集引用?)"

Hi
In my cs code i have 2 foreach loop for GridViewRow and GridViewColumn
i am using System.Web.UI.WebControls namespace.for GridViewColumn getting error as "Error 3 The type or namespace name ''GridViewColumn'' could not be found (are you missing a using directive or an assembly reference?)"

foreach (GridViewRow row in ItemGv.Rows)
   {
   //code --
   }





foreach (GridViewColumn column in ItemGv.Columns)
     {
     //code
     }



你能帮忙吗

谢谢



could you please help in this

Thanks

推荐答案



没有名为GridViewColumn的属性

如果要遍历gridview的所有列,请

Hi,

There is no property called GridViewColumn

If you want to loop through all the columns of a gridview then

for(int i=0;i<urgridid.Columns.Count;i++)
{
//write your logic here
}



希望对您有所帮助....



Hope this helps....




尝试替换上面的代码行:

Hi,

Try to replace above code line:

foreach (GridViewColumn column in ItemGv.Columns)
{
    //code
}




与:




with:

foreach (var column in this.ItemGv.Columns)
{
    //code -- 
}



希望这可以帮助...



Hope this could help...

Regards,


您到底想达到什么目的?由于没有作为GridViewColumn的属性,因此上述两种解决方案都将有所帮助.您将必须通过GridView.Column属性进行引用
What exactly are you trying to achieve? Both of the above solutions would help since there is no property as GridViewColumn. You will have to make a ref through the GridView.Column property


这篇关于GridViewColumn组装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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