Commit 2968253f HZH

增加数据绑定事件

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