关于继承GridView控件的问题!
我现在有个一个Class,叫做CRUDGridView它继承于GridView.我没有重写原有GridView的任何方法,只是在CRUDGridView的构造函数中添加了几个事件的处理。
public CRUDGridView()
{
sqlDataSource = new SqlDataSource();
sqlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["Pubs"].ConnectionString;
this.DataSource = sqlDataSource;
this.RowDeleting += new GridViewDeleteEventHandler(CRUDGridView_RowDeleting);
this.RowDataBound += new GridViewRowEventHandler(CRUDGridView_RowDataBound);
this.RowCommand += new GridViewCommandEventHandler(CRUDGridView_RowCommand);
this.Load += new EventHandler(CRUDGridView_Load);
}
,现在的问题是,在RowDeleting事件触发时,程序能跳到CRUDGridView_RowDeleting进行处理,但是
protected void CRUDGridView_RowDeleting(object sender, GridViewDeleteEventArgs e)
中的GridViewDeleteEventArgs e 的e.Values没有任何内容,也就是说我不能通过e.Values["au_id"]来获取数据。
请问高手,这是什么原因?我该怎么解决?