天天看點

在GridView的RowCommand事件裡面取得對應激發事件的列。

protected   void  EduView_RowCommand( object  sender, GridViewCommandEventArgs e)

        {

             if  (e.CommandName  ==   " EduEdit " )

            {

                LinkButton lk  =  (LinkButton)e.CommandSource;

                GridViewRow dr  =  (GridViewRow)lk.Parent.Parent;  // 取得對應行

            }

        }

轉載于:https://www.cnblogs.com/Mercury/archive/2007/09/11/889583.html