节选自实际项目中的部分代码

节选自实际项目中的部分代码

[ParseChildren(true)][PersistChildren(false)][ToolboxData("{0}:GridViewPlusrunat=server/{0}:GridViewPlus")][ToolboxBitmap(typeof(GridView))]publicclassGridViewPlus:GridView{#regionconstructorspublicGridViewPlus():base(){}publicGridViewPlus(stringpId){this.ID=MyHelper.ToString(pId);}#endregionconstructorspublicdelegatevoidRowDblClickEventHandler(objectsender,intRowIndex);publiceventRowDblClickEventHandlerRowDblClick;protectedoverridevoidOnLoad(EventArgse){base.OnLoad(e);this.Load_RowDblClickEventHandler();}protectedvirtualvoidOnRowDblClick(objectsender,intRowIndex){this.SelectedIndex=RowIndex;}privatevoidLoad_RowDblClickEventHandler(){string_EventTarget=MyHelper.ToString(this.Page.Request.Params["__EVENTTARGET"]);string[]_EventArguments=MyHelper.ToString(this.Page.Request.Params["__EVENTARGUMENT"]).Split('$');string_EventName=MyHelper.ToString(_EventArguments[0]);if(_EventTarget==this.ID_EventName=="RowDblClick"){int_index=MyHelper.ToInt(_EventArguments[1]);this.RowDblClick(this,_index);}}protectedoverridevoidOnRowDataBound(GridViewRowEventArgse){GridViewRow_row=e.Row;string_index=MyHelper.ToString(_row.RowIndex);string_arg="RowDblClick$"+_index;string_evt=this.Page.ClientScript.GetPostBackEventReference(this,_arg);_row.Attributes.Add("ondblclick",_evt);}}//endclass