|
@@ -200,7 +200,6 @@ public class DynamicGridGridUIComponent<T> : IDynamicGridUIComponent<T>, IDynami
|
|
|
|
|
|
DataGrid.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Visible);
|
|
DataGrid.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Visible);
|
|
|
|
|
|
- DataGrid.FilterChanging += DataGrid_FilterChanging;
|
|
|
|
DataGrid.FilterChanged += DataGrid_FilterChanged;
|
|
DataGrid.FilterChanged += DataGrid_FilterChanged;
|
|
|
|
|
|
var fltstyle = new Style(typeof(GridFilterControl));
|
|
var fltstyle = new Style(typeof(GridFilterControl));
|
|
@@ -547,27 +546,8 @@ public class DynamicGridGridUIComponent<T> : IDynamicGridUIComponent<T>, IDynami
|
|
return reloadColumns && DataGrid.Columns.Count > 0;
|
|
return reloadColumns && DataGrid.Columns.Count > 0;
|
|
}
|
|
}
|
|
|
|
|
|
- private void DataGrid_FilterChanging(object? sender, GridFilterEventArgs e)
|
|
|
|
- {
|
|
|
|
- var col = GetColumn(DataGrid.Columns.IndexOf(e.Column)) as DynamicActionColumn;
|
|
|
|
- if (col?.GetFilterExpression != null)
|
|
|
|
- {
|
|
|
|
- col.SetFilters(e.FilterPredicates);
|
|
|
|
- var view = (DataGrid.ItemsSource as DataTable)?.DefaultView;
|
|
|
|
- view.ApplyFilters(ColumnList.OfType<DynamicActionColumn>());
|
|
|
|
- e.Handled = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void DataGrid_FilterChanged(object? o, GridFilterEventArgs e)
|
|
private void DataGrid_FilterChanged(object? o, GridFilterEventArgs e)
|
|
{
|
|
{
|
|
- var col = DataGrid.Columns.IndexOf(e.Column);
|
|
|
|
- if (GetColumn(col) is DynamicActionColumn column)
|
|
|
|
- {
|
|
|
|
- column.SetFilters(e.FilterPredicates);
|
|
|
|
- e.Handled = true;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (e.FilterPredicates == null)
|
|
if (e.FilterPredicates == null)
|
|
{
|
|
{
|
|
if (_filterpredicates.ContainsKey(e.Column.MappingName))
|
|
if (_filterpredicates.ContainsKey(e.Column.MappingName))
|
|
@@ -1157,7 +1137,6 @@ public class DynamicGridGridUIComponent<T> : IDynamicGridUIComponent<T>, IDynami
|
|
newcol.Width = column.Width;
|
|
newcol.Width = column.Width;
|
|
newcol.ColumnSizer = GridLengthUnitType.None;
|
|
newcol.ColumnSizer = GridLengthUnitType.None;
|
|
newcol.HeaderText = column.HeaderText;
|
|
newcol.HeaderText = column.HeaderText;
|
|
- newcol.AllowFiltering = (column.Filters != null && column.Filters.Length != 0) || column.FilterRecord is not null;
|
|
|
|
newcol.AllowSorting = false;
|
|
newcol.AllowSorting = false;
|
|
newcol.FilterRowOptionsVisibility = Visibility.Collapsed;
|
|
newcol.FilterRowOptionsVisibility = Visibility.Collapsed;
|
|
newcol.ShowHeaderToolTip = column.ToolTip != null;
|
|
newcol.ShowHeaderToolTip = column.ToolTip != null;
|