示例#1
0
 /// <summary>
 /// 触发<see cref="RowCommand"/>事件。
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnRowCommand(DataGridViewCommandEventArgs e)
 {
     DataGridViewCommandEventHandler handler = this.RowCommand;
     if (handler != null)
         handler(this, e);
 }
 /// <summary>
 /// 确定是否将事件沿页面的 ASP.NET 服务器控件层次结构向上传递。
 /// </summary>
 /// <param name="source"></param>
 /// <param name="args"></param>
 /// <returns></returns>
 protected override bool OnBubbleEvent(object source, EventArgs args)
 {
     if (args is CommandEventArgs)
     {
         DataGridViewCommandEventArgs e = new DataGridViewCommandEventArgs(this, source, (CommandEventArgs)args);
         base.RaiseBubbleEvent(this, e);
         return true;
     }
     return false;
 }
示例#3
0
 /// <summary>
 ///  控件回发到服务器时引发此控件的合适的事件。
 /// </summary>
 /// <param name="eventArgument">事件参数。</param>
 public void RaisePostBackEvent(string eventArgument)
 {
     this.ValidateEvent(this.UniqueID, eventArgument);
     int index = eventArgument.IndexOf('$');
     if (index >= 0)
     {
         CommandEventArgs originalArgs = new CommandEventArgs(eventArgument.Substring(0, index), eventArgument.Substring(index + 1));
         DataGridViewCommandEventArgs e = new DataGridViewCommandEventArgs(null, this, originalArgs);
         this.HandleEvent(e, false, string.Empty);
     }
     else
     {
         this.InvokeBuildDataSource();
     }
 }