Gridview绑定到数组g,删除一行如何实现?
删除效果没出来?
public partial class _Default : System.Web.UI.Page
{
int m;
protected void Page_Load(object sender, EventArgs e)
{
string[] g = new string[4];
g[0] = "aa";
g[1] = "bb";
g[2] = "cc";
g[3] = "dd";
GridView1.DataSource = g;
GridView1.DataBind();
if(!this.IsPostBack)
m = 3;
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridViewRow row = GridView1.Rows[e.RowIndex];
Label1.Text = row.Cells[2].Text;
}
------解决方案--------------------