using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq.Expressions; using System.Windows; using System.Windows.Controls.Primitives; using System.Windows.Data; using System.Windows.Input; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Shapes; using ExtendedGrid.Classes; using ExtendedGrid.Converter; using ExtendedGrid.ExtendedGridControl; using ExtendedGrid.Interface; using System.Linq; using Microsoft.Windows.Themes; using Application = System.Windows.Application; using Button = System.Windows.Controls.Button; using CheckBox = System.Windows.Controls.CheckBox; using Cursors = System.Windows.Input.Cursors; using Expression = System.Windows.Expression; using ListBox = System.Windows.Controls.ListBox; using MouseEventArgs = System.Windows.Input.MouseEventArgs; namespace ExtendedGrid.Styles { public partial class DataGridGeneric { private void AutoFilterMouseDown(object sender, MouseButtonEventArgs e) { TextBox textSearchBox=null; try { e.Handled = true; if (e.ChangedButton == MouseButton.Right) return; var column = FindControls.FindParent((ContentControl)sender); if (string.IsNullOrEmpty(column.Column.SortMemberPath)) { return; } var extendedColumn = column.Column as IExtendedColumn; if (extendedColumn != null) { if (!extendedColumn.AllowAutoFilter) return; } var popup = FindControls.FindChild(column, "popupDrag"); if (popup == null) return; popup.IsOpen = true; //Change the position of popup with the mouse var popupSize = new Size(popup.ActualWidth, popup.ActualHeight); var position = new Point { X = column.ActualWidth - 19, Y = column.ActualHeight }; popup.PlacementRectangle = new Rect(position, popupSize); var listbox = FindControls.FindChild(popup.Child, "autoFilterList"); listbox.Focus(); //listbox.LostFocus += PopLostFocus; Removed this becuase event was suscribing again and again on each mouse down var clearButton = FindControls.FindChild