Commit 2968253f HZH

增加数据绑定事件

1 个父辈 691bef6f
...@@ -230,6 +230,10 @@ namespace HZH_Controls.Controls ...@@ -230,6 +230,10 @@ namespace HZH_Controls.Controls
{ {
ReloadSource(); ReloadSource();
} }
if (BindingSourceEvent != null)
{
BindingSourceEvent(this, null);
}
} }
} }
...@@ -450,13 +454,15 @@ namespace HZH_Controls.Controls ...@@ -450,13 +454,15 @@ namespace HZH_Controls.Controls
/// <summary> /// <summary>
/// Occurs when [source changed]. /// Occurs when [source changed].
/// </summary> /// </summary>
[Description("数据源改变事件"), Category("自定义")] [Description("数据源改变事件"), Category("自定义")]
public event DataGridViewEventHandler SourceChanged; public event DataGridViewEventHandler RowSourceChangedEvent;
/// <summary> /// <summary>
/// Occurs when [row custom event]. /// Occurs when [row custom event].
/// </summary> /// </summary>
[Description("预留的自定义的事件,比如你需要在行上放置删改等按钮时,可以通过此事件传递出来"), Category("自定义")] [Description("预留的自定义的事件,比如你需要在行上放置删改等按钮时,可以通过此事件传递出来"), Category("自定义")]
public event DataGridViewRowCustomEventHandler RowCustomEvent; public event DataGridViewRowCustomEventHandler RowCustomEvent;
[Description("绑定数据源后事件"), Category("自定义")]
public event EventHandler BindingSourceEvent;
#endregion #endregion
#endregion #endregion
...@@ -798,8 +804,8 @@ namespace HZH_Controls.Controls ...@@ -798,8 +804,8 @@ namespace HZH_Controls.Controls
/// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param>
void RowSourceChanged(object sender, DataGridViewEventArgs e) void RowSourceChanged(object sender, DataGridViewEventArgs e)
{ {
if (SourceChanged != null) if (RowSourceChangedEvent != null)
SourceChanged(sender, e); RowSourceChangedEvent(sender, e);
} }
/// <summary> /// <summary>
/// Sets the select row. /// Sets the select row.
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!