This commit is contained in:
Sunny 2022-06-19 17:35:45 +08:00
commit 15c857d91c
4 changed files with 34 additions and 0 deletions

View File

@ -15,6 +15,8 @@ namespace Sunny.UI
private UISymbolButton btnClear; private UISymbolButton btnClear;
private UIDataGridView dataGridView; private UIDataGridView dataGridView;
public event OnComboDataGridViewFilterChanged ComboDataGridViewFilterChanged;
public UIComboDataGridViewItem() public UIComboDataGridViewItem()
{ {
InitializeComponent(); InitializeComponent();
@ -364,6 +366,8 @@ namespace Sunny.UI
{ {
table.DefaultView.RowFilter = filter; table.DefaultView.RowFilter = filter;
} }
ComboDataGridViewFilterChanged?.Invoke(this, new UIComboDataGridViewArgs(edtFilter.Text, dataGridView.RowCount));
} }
private void btnClear_Click(object sender, System.EventArgs e) private void btnClear_Click(object sender, System.EventArgs e)

View File

@ -201,4 +201,23 @@ namespace Sunny.UI
itemForm.SetStyle(style); itemForm.SetStyle(style);
} }
} }
public delegate void OnComboDataGridViewFilterChanged(object sender, UIComboDataGridViewArgs e);
public class UIComboDataGridViewArgs : EventArgs
{
public string FilterText { get; set; }
public int FilterCount { get; set; }
public UIComboDataGridViewArgs()
{
}
public UIComboDataGridViewArgs(string filterText, int filterCount)
{
FilterText = filterText;
FilterCount = filterCount;
}
}
} }

View File

@ -21,6 +21,7 @@
* 2022-03-22: V3.1.1 * 2022-03-22: V3.1.1
* 2022-04-16: V3.1.3 * 2022-04-16: V3.1.3
* 2022-06-16: V3.2.0 * 2022-06-16: V3.2.0
* 2022-06-19: V3.2.0 FilterChanged
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -52,6 +53,8 @@ namespace Sunny.UI
DropDownHeight = 300; DropDownHeight = 300;
} }
public event OnComboDataGridViewFilterChanged FilterChanged;
[DefaultValue(500)] [DefaultValue(500)]
[Description("下拉框宽度"), Category("SunnyUI")] [Description("下拉框宽度"), Category("SunnyUI")]
public int DropDownWidth { get; set; } public int DropDownWidth { get; set; }
@ -70,6 +73,12 @@ namespace Sunny.UI
item.Translate(); item.Translate();
//ItemForm.Show(this); //ItemForm.Show(this);
ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight)); ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight));
item.ComboDataGridViewFilterChanged += Item_ComboDataGridViewFilterChanged;
}
private void Item_ComboDataGridViewFilterChanged(object sender, UIComboDataGridViewArgs e)
{
FilterChanged?.Invoke(this, e);
} }
[DefaultValue(typeof(Size), "320, 240"), Description("下拉弹框界面大小"), Category("SunnyUI")] [DefaultValue(typeof(Size), "320, 240"), Description("下拉弹框界面大小"), Category("SunnyUI")]

View File

@ -29,6 +29,7 @@
* 2022-04-20: V3.1.5 * 2022-04-20: V3.1.5
* 2022-05-11: V3.1.8 使 * 2022-05-11: V3.1.8 使
* 2022-05-17: V3.1.9 * 2022-05-17: V3.1.9
* 2022-06-19: V3.2.0 UIPage的FormClosed事件
******************************************************************************/ ******************************************************************************/
using Sunny.UI.Win32; using Sunny.UI.Win32;
@ -818,6 +819,7 @@ namespace Sunny.UI
if (AutoClosePage) if (AutoClosePage)
{ {
pages[i].Final(); pages[i].Final();
pages[i].Close();
pages[i].Dispose(); pages[i].Dispose();
pages[i] = null; pages[i] = null;
} }