我有一個gridview GridViewTranstoCon
內主gridview GridViewTtransmittals
。 現在爲GridViewTranstoCon_RowDeleting
我已經寫了下面的代碼,但它是失敗的。如何gridview行刪除嵌套gridview
protected void GridViewTranstoCon_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridView TranstoCon = GridViewTtransmittals.FindControl("GridViewTranstoCon") as GridView;
OnDeleteTtransmittaltocon(Convert.ToInt32(TranstoCon.DataKeys[e.RowIndex].Value));
}
private void OnDeleteTtransmittaltocon(int transmittoconid,int transid)
{
if (DeleteTransmittaltocon != null)
{
DeleteTransmittaltocon(this, new tbltranstoconEventArgs { TransmittoconID = transmittoconid, TransID = transid });
// DeleteTransmittaltocon(this, new tbltranstoconEventArgs { TransmittoconID = transmittoconid });
}
}
而我的事件處理程序就像下面,我不知道如何添加另一個aegument。
public class tbltransmittalNoEventArgs : EventArgs
{
public int TransID { get; set; }
}
public class tbltranstoconEventArgs : EventArgs
{
public int TransmittoconID { get; set; }
public int TransID { get; set; }
}
public event EventHandler<tbltranstoconEventArgs> DeleteTransmittaltocon;
我該怎麼辦?
請幫忙是什麼問題GridView控件。因爲我是新來的asp.net.some代碼或樣本將是非常好的我。 – masoud