GridView问题
using System;using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class admin_gridview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button2_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
foreach(GridView gr in GridView1.Rows)
{
CheckBox chk = (CheckBox)gr.Cells[5].FindControl["chk"];
if (chk.Checked)
{
chk.Checked = false;
}
else
{
chk.Checked = true;
}
}
}
}
[bold]编译器错误信息: [/bold]CS0117: “System.Web.UI.WebControls.GridView”并不包含“Cells”的定义