Asp.net Gridview错误 [英] Asp.net Gridview error

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

问题描述

我有以下代码:



  else   if (e.Row.Cells [ 5 ]。文字==   
{
e.Row.Cells [ 5 ]。BackColor = System.Drawing.Color.Red;
}



及其给我一个错误:



System.Web .UI.WebControls.GridViewCommandEventArgs'不包含'Row'的定义,并且没有扩展方法'Row'可以找到类型'System.Web.UI.WebControls.GridViewCommandEventArgs'的第一个参数(你是否缺少using指令)或汇编参考?



如何解决此问题?

解决方案

检查出来,它是在vb.net中,但想法是一样的:

如何检索所选行-value-value-using-command-row-in-gridview [ ^ ]

I have the following code:

else if (e.Row.Cells[5].Text == "")
               {
                   e.Row.Cells[5].BackColor = System.Drawing.Color.Red;
               }


and its giving me an error:

System.Web.UI.WebControls.GridViewCommandEventArgs' does not contain a definition for 'Row' and no extension method 'Row' accepting a first argument of type 'System.Web.UI.WebControls.GridViewCommandEventArgs' could be found (are you missing a using directive or an assembly reference?

How can I resolve this?

解决方案

Check this out, it is in vb.net, but the idea is the same:
how-to-retrieve-the-selected-row-value-using-command-row-in-gridview[^]


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

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