Example #1
0
        void AddItems(TextColumnFilterDialog dialog, Table table, int col)
        {
            string[] toAdd = GetDistinctItems(table, col);

            foreach (string item in toAdd)
            {
                dialog.AddItem(item, ItemIsChecked(item));
            }
        }
Example #2
0
        TextColumnFilterDialog CreateFilterDialog(HeaderMouseEventArgs e)
        {
            var dialog = new TextColumnFilterDialog();

            Point screenPos = e.Table.PointToScreen(new Point(e.HeaderRect.Left, e.HeaderRect.Bottom));

            dialog.StartPosition = FormStartPosition.Manual;

            dialog.Location = screenPos;

            return(dialog);
        }
Example #3
0
 void UpdateFilter(HeaderMouseEventArgs e, TextColumnFilterDialog dialog)
 {
     if (dialog.AnyUncheckedItems())
     {
         SetFilterItems(dialog.GetCheckedItems());
     }
     else
     {
         SetFilterItems(null);   // The user has ticked every item - so no filtering is needed
     }
     e.Table.OnHeaderFilterChanged(e);
 }
Example #4
0
        /// <summary>
        /// Called when the filter button is clicked on this column
        /// </summary>
        /// <param name="e"></param>
        public void OnHeaderFilterClick(HeaderMouseEventArgs e)
        {
            TextColumnFilterDialog dialog = CreateFilterDialog(e);

            AddItems(dialog, e.Table, e.Index);

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            UpdateFilter(e, dialog);
        }
Example #5
0
        void UpdateFilter(HeaderMouseEventArgs e, TextColumnFilterDialog dialog)
        {
            if (dialog.AnyUncheckedItems())
                SetFilterItems(dialog.GetCheckedItems());
            else
                SetFilterItems(null);   // The user has ticked every item - so no filtering is needed

            e.Table.OnHeaderFilterChanged(e);
        }
Example #6
0
        TextColumnFilterDialog CreateFilterDialog(HeaderMouseEventArgs e)
        {
            var dialog = new TextColumnFilterDialog();

            Point screenPos = e.Table.PointToScreen(new Point(e.HeaderRect.Left, e.HeaderRect.Bottom));

            dialog.StartPosition = FormStartPosition.Manual;

            dialog.Location = screenPos;

            return dialog;
        }
Example #7
0
        void AddItems(TextColumnFilterDialog dialog, Table table, int col)
        {
            string[] toAdd = GetDistinctItems(table, col);

            foreach (string item in toAdd)
            {
                dialog.AddItem(item, ItemIsChecked(item));
            }
        }