SVN r485
SVN-Revision: r485
This commit is contained in:
@@ -2394,18 +2394,19 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
}
|
||||
public override void OnShowFilterPopupCheckedListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupCheckedListBoxEventArgs e)
|
||||
public void OnShowFilterPopupCheckedListBox(object sender, DevExpress.XtraGrid.Views.Grid.FilterPopupCheckedListBoxEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
GridView gridView = (GridView)sender;
|
||||
DataTable filterTable = gridView.GetFilteredAndSortedDataTable();
|
||||
|
||||
BandedGridView gridView = (BandedGridView)sender;
|
||||
|
||||
string actStr = this.bandedGridView.ActiveFilterString;//获取筛选条件
|
||||
string[] actStr_list = actStr.Split(new string[] { "And" }, StringSplitOptions.None);
|
||||
|
||||
DataTable datatable = new DataTable();
|
||||
|
||||
|
||||
if (!actStr_list[0].Contains(e.Column.FieldName) && actStr != "")
|
||||
if ((!actStr_list[0].Contains(e.Column.FieldName) || (this.bandedGridView.OptionsView.ShowAutoFilterRow && e.Column.FilterInfo.Type == ColumnFilterType.AutoFilter)) && actStr != "")
|
||||
{
|
||||
CriteriaOperator criteria_op = this.bandedGridView.ActiveFilterCriteria;
|
||||
GroupOperator group_op = new GroupOperator();
|
||||
@@ -2511,24 +2512,49 @@ namespace Lskj.Control
|
||||
e.CheckedComboBox.HighlightedItemStyle = HighlightStyle.Skinned;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < e.CheckedComboBox.Items.Count(); i++)
|
||||
|
||||
|
||||
|
||||
|
||||
if (!SystemInfo.Instance.DisableFilteringQuantity)
|
||||
{
|
||||
try
|
||||
DataTable filterTable = gridView.GetGridViewFilteredAndSortedDataToDataTable();
|
||||
DataRow[] dataRowArray = filterTable.Select();
|
||||
DevExpress.XtraEditors.Controls.CheckedListBoxItemCollection _Items = new DevExpress.XtraEditors.Controls.CheckedListBoxItemCollection();
|
||||
|
||||
for (int i = 0; i < e.CheckedComboBox.Items.Count(); i++)
|
||||
{
|
||||
CheckedListBoxItem checkedListBoxItem = e.CheckedComboBox.Items[i];
|
||||
if (checkedListBoxItem.Value is FilterItem)
|
||||
try
|
||||
{
|
||||
CheckedListBoxItem checkedListBoxItem = e.CheckedComboBox.Items[i];
|
||||
if (checkedListBoxItem.Value is FilterItem)
|
||||
{
|
||||
FilterItem filterItem = (FilterItem)checkedListBoxItem.Value;
|
||||
string text = filterItem.Text;
|
||||
object value = filterItem.Value;
|
||||
int count = dataRowArray.Where(n => (n[e.Column.FieldName] + "").Equals(value + "")).Count();
|
||||
checkedListBoxItem.Description = $"{text} ({count})";
|
||||
if (count > 0) _Items.Add(checkedListBoxItem);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
FilterItem filterItem = (FilterItem)checkedListBoxItem.Value;
|
||||
string text = filterItem.Text;
|
||||
object value = filterItem.Value;
|
||||
int count = filterTable.Select().Where(n => (n[e.Column.FieldName] + "").Equals(value + "")).Count();
|
||||
checkedListBoxItem.Description = $"{text} ({count})";
|
||||
}
|
||||
}
|
||||
finally
|
||||
//多表头在使用自带的搜索功能时(ctrl+f),筛选框无法过滤搜索后的内容,根据判断是否有搜索值去手动过滤
|
||||
bool isSearch = !string.IsNullOrWhiteSpace(gridView.FindFilterText);
|
||||
if (isSearch)
|
||||
{
|
||||
e.CheckedComboBox.Items.Clear();
|
||||
for (int i = 0; i < _Items.Count; i++)
|
||||
{
|
||||
e.CheckedComboBox.Items.Add(_Items[i]);
|
||||
}
|
||||
e.CheckedComboBox.HighlightedItemStyle = HighlightStyle.Skinned;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user