Click here to Skip to main content
14,331,160 members

Automatic WPF Toolkit DataGrid Filtering

Rate this:
4.93 (103 votes)
Please Sign up or sign in to vote.
4.93 (103 votes)
21 May 2010BSD
This article discusses a component that enables automated content filtering for the WPF Toolkit DataGrid.
Automated content filtering for the WPF Toolkit DataGrid - demo application

Introduction

The article discusses a component that enables automated content filtering for the DataGrid (WPF Toolkit DataGrid or System.Windows.Controls.DataGrid). The inspiration was the article "DataGrid with built-in filter functionality" (for Windows Forms) that was also published on CodeProject.

A specific characteristic of this component is that it is not an inherited DataGrid control, but instead a new style is made for the DataGrid's header. That makes future upgrades easier, and increases compatibility with the DataGrid control.

Using this component is extremely simple, you only need to set a new style for the DataGrid header: ColumnHeaderStyle.

With the release of .NET Framework 4.0, DataGrid has become part of the framework, so there is also a Visual Studio 2010 solution without WPFToolkit.dll.

Background

The component uses the LINQ Dynamic Query Library to build up the query string for DataGrid filtering. You should be familiar with the WPF concept of binding, templates, and styles.

Using the Code

Use of the component should be easy. You first have to add a reference to the DataGrid component and for the DataGridFilterLibrary project (or DLL if you wish). For .NET 4.0, add a "PresentationFramework.dll" reference, and for .NET 3.5, add a "WPFToolkit.dll" reference.

Then, in the XAML code where you have the DataGrid, you have to add the xmlns attribute to the root element of the markup file (namespaces wpftoolkit and filter).

Note that for a project that targets .NET 4.0, there is no need to add the WPF Toolkit reference.

<Window x:Class="DataGridFilterTest.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:wpftoolkit="http://schemas.microsoft.com/wpf/2008/toolkit"

    xmlns:filter="clr-namespace:DataGridFilterLibrary;assembly=DataGridFilterLibrary"

Finally, you have to set a custom header style for the DataGrid:

<DataGrid ColumnHeaderStyle="{StaticResource {ComponentResourceKey 
           TypeInTargetAssembly={x:Type filter:DataGridHeaderFilterControl}, 
           ResourceId=DataGridHeaderFilterControlStyle}}"

Please note that if you want to use shared resources from a Custom Control Library, you must use the ComponentResourceKey markup extension to reference the resource in the DataGridFilterLibrary.

Using DataGridComboBoxColumn

The filter for distinct values (see the EmployeePosition type in the demo project) can be distinct, or the user can enter any text in the TextBox. In the latter case, the search is executed as a text search with the LIKE operator. This behaviour is adjusted using the attached property IsTextFilter.

Example

<DataGridComboBoxColumn Header="Position (List Filter)"

    filter:DataGridComboBoxExtensions.UserCanEnterText="True"

    SelectedItemBinding="{Binding Path=Position}"

    ItemsSource="{Binding Source={StaticResource EmployeeData}, Path=EmployeePositionList}" 

    SelectedValuePath="Id"

    DisplayMemberPath="Name">

The filter control for this DataGridComboBoxColumn is going to be a simple TextBox instead of the ComboBox with all-possible values for the employee position (see the column "Position - List Filter" in the demo project).

This is handy when the list has many items, e.g., 100 employee positions.

How Text Search Works

All text searches through the <textbox> are by default case insensitive searches (as the LIKE SQL clause). The filter control also supports wildcard character % operators.

Configuration Options

Configuration is implemented through attached properties. See the following classes: DataGridColumnExtensions, DataGridComboBoxExtensions, and DataGridExtensions.

UserCanEnterText

  • When applied to the combobox column, the filter combobox is fully editable, i.e., the user can type part of the word and the combobox automatically selects the first appropriate item (like System.Windows.Controls.TextSearch).
  • Default is false.
  • For example, see Position (Text Filter) column.

Example

<DataGridComboBoxColumn

    Header="Position (List Filter)"

    filter:DataGridComboBoxExtensions.UserCanEnterText="True"

    <!-- The rest was left out to keep it more simple -->

IsCaseSensitiveSearch

  • When applied to the text column, search is case sensitive.
  • Default is false.
  • For example, see Email (Case Sensitive Search) column.

Example

<DataGridTextColumn Binding="{Binding Path=Email}"

    filter:DataGridColumnExtensions.IsCaseSensitiveSearch="True"

    Header="Email (Case Sensitive Search)"/>

IsBetweenFilterControl

  • For numeric and date columns, there is the option to filter between, i.e., that gives you the ability to specify a range in your search.
  • Default is false.
  • For example, see the Work Experience (Between) and Date Of Birth (Between) columns.

Example

<DataGridTextColumn Header="Work Experience (Between)" 

    filter:DataGridColumnExtensions.IsBetweenFilterControl="True"

    Binding="{Binding Path=WorkExperience}"/>

UseBackgroundWorkerForFiltering

  • When applied to the datagrid, searches are performed on a separate thread using the BackgroundWorker.
  • Default is false.
  • For example, see the grid on the second tab item (myGrid2).

Example

<DataGrid filter:DataGridExtensions.UseBackgroundWorkerForFiltering="True" 

    <!-- The rest was left out to keep it more simple -->

DoNotGenerateFilterControl

  • Gives the possibility to switch off the filter for a single column (useful for columns that do not need a filter, e.g., button columns).
  • For example, see the first grid where the filter for the column "Id" is hidden.

Example

<DataGridTextColumn filter:DataGridColumnExtensions.DoNotGenerateFilterControl="True" 

    <!-- The rest was left out to keep it more simple -->

IsClearButtonVisible

  • Shows/hides the "Clear filter" button.
  • Default is true.
  • For example, see the first grid where the clear filter button is hidden.

Example

<DataGrid 

    filter:DataGridExtensions.IsClearButtonVisible="False"

    <!-- The rest was left out to keep it more simple -->

Control Commands

IsFilterVisible

It is not really a command, but an attached property. The property controls the visibility of the filter. It can be bound to a toolbar item. For example, see the "Show/Hide Filter (bind to attached property)" toolbar item.

<CheckBox IsChecked="{Binding Path=(filter:DataGridExtensions.IsFilterVisible),
                              ElementName=myGrid1}">
    Show/Hide Filter (bind to attached property)
</CheckBox/>

ClearFilterCommand

Clears the filter content and resets the filter. For example, see the "Clear Filter" toolbar item.

<Button Command="{Binding Path=(filter:DataGridExtensions.ClearFilterCommand), 
                          ElementName=myGrid1}">
    Clear Filter
</Button>

Please note that in the above case, we are binding to the attached properties. Syntax for this is in the form: Path=(namespace prefix:class name.property name, surrounded by parentheses), e.g.:

Path=(filter:DataGridExtensions.ClearFilterCommand)

Notes

The filter library internally uses (also indicated in the code):

  • Delay Textbox
  • (My WPF port of the Windows Forms version: http://www.codeproject.com/KB/miscctrl/CustomTextBox.aspx) - for smooth and responsive performance, thus simulating a kind of incremental search. For example, if the user types letters "A-B-C" in intervals less than 250 milliseconds, a search for an ABC text is performed, not 3 searches for A, AB, ABC.

  • EnumDisplayer
  • For better handling of enum values of the filter (http://www.ageektrapped.com/blog/the-missing-net-7-displaying-enums-in-wpf)

  • DataGridComboBoxColumn vs. DataGridComboBoxColumnWithBindingHack
  • To show the data in the combo box, the previous version used the DataGridComboBoxColumnWithBindingHack class. The solution for the modified combo column can be found here.

    Now I am using ObjectDataProvider as a binding source, so the ComboBox.ItemsSource binds to the EmployeePositionList through a StaticResource. For more information, see: WPF DataGrid – Dynamically updating DataGridComboBoxColumn. For this reason, the DataGridComboBoxColumn class is used instead of DataGridComboBoxColumnWithBindingHack.

    The example usage (both) is shown in the XAML code of the test project.

  • Start inserting Employees with new position
  • When pressed, every second, an employee (also with a new Position, i.e., Position 1, Position 2, Position 3 ...) is inserted in the EmployeeList list. If DataGrid.ItemsSource is an observable collection (source implements INotifyCollectionChanged) and a filter is set, the filter detects a collection change and then re-executes the filtering. Try and set the letter "p" in the filter for the "Position (Text Filter)" column and then press the button.

History

19-05-2010

  • Added DoNotGenerateFilterControl configuration options (see chapter: Configuration options)
  • Filter detects collection change (only if source implements INotifyCollectionChanged) and then re-executes the filtering
  • (Some) Bug fixes - all bugs were found, thanks to the posted messages :)

10-01-2009

  • Thanks to Bob Ranck and jsh_ec for their proposals and suggestions
  • Added the between control for date and numeric fields (option)
  • Added various configuration options (see chapter: Configuration options)
  • Added a clear filter command and a property that controls filter visibility
  • Now the filter adds a blank combobox item at the beginning of each list - quick and easy filter reset
  • Internal code revision

09-09-2009

  • This is the first version. There are places for improvements in the internal design and functionality of the code components. Suggestions and comments are welcome.

License

This article, along with any associated source code and files, is licensed under The BSD License

Share

About the Author

smatusan
Software Developer Fireminds
Croatia Croatia
Sanjin Matusan - C#, WPF, SQL, .NET

Comments and Discussions

 
GeneralRe: Enum as combox source Pin
cwmjo18-Jul-11 0:30
membercwmjo18-Jul-11 0:30 
GeneralRe: Enum as combox source [modified] Pin
smatusan25-Jul-11 11:28
membersmatusan25-Jul-11 11:28 
GeneralMy vote of 5 Pin
Bender197816-May-11 3:18
memberBender197816-May-11 3:18 
GeneralRe: My vote of 5 Pin
smatusan16-May-11 10:10
membersmatusan16-May-11 10:10 
GeneralBetweenFilter Pin
Bender197815-May-11 21:29
memberBender197815-May-11 21:29 
GeneralRe: BetweenFilter Pin
smatusan16-May-11 10:10
membersmatusan16-May-11 10:10 
GeneralRe: BetweenFilter Pin
Bender197816-May-11 21:07
memberBender197816-May-11 21:07 
GeneralException when trying to add new data while filtering is active Pin
Nicolai Schrade11-May-11 0:08
memberNicolai Schrade11-May-11 0:08 
Hi,

one more question, sorry Smile | :)

I get an exception when trying to add a new line into the datagrid while a filter is active.

Here's a screenshot:
Exception screenshot

And here's the stacktrace:
System.InvalidOperationException wurde nicht behandelt.
  Message="Filter" ist während einer AddNew- oder EditItem-Transaktion nicht zulässig.
  Source=PresentationFramework
  StackTrace:
       bei System.Windows.Data.ListCollectionView.set_Filter(Predicate`1 value)
       bei REASE2_Lib.Querying.QueryController.<>c__DisplayClassb.<applayFilter>b__7() in C:\REASE2-Projekte_lokal\REASE2_Teamprojekt\REASE2\REASE2_LibCSharp\DataGridFilter\Querying\QueryController.cs:Zeile 213.
       bei REASE2_Lib.Querying.QueryController.invoke(Action action) in C:\REASE2-Projekte_lokal\REASE2_Teamprojekt\REASE2\REASE2_LibCSharp\DataGridFilter\Querying\QueryController.cs:Zeile 295.
       bei REASE2_Lib.Querying.QueryController.<>c__DisplayClass16.<executeActionUsingDispatcher>b__14() in C:\REASE2-Projekte_lokal\REASE2_Teamprojekt\REASE2\REASE2_LibCSharp\DataGridFilter\Querying\QueryController.cs:Zeile 280.
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
       bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       bei System.Threading.ExecutionContext.runTryCode(Object userData)
       bei System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Windows.Threading.DispatcherOperation.Invoke()
       bei System.Windows.Threading.Dispatcher.ProcessQueue()
       bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bei System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
       bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei System.Windows.Threading.Dispatcher.Invoke(Delegate method, DispatcherPriority priority, Object[] args)
       bei REASE2.ucDataGrid.ucDataGrid_RowEditEnding(Object sender, DataGridRowEditEndingEventArgs e) in C:\REASE2-Projekte_lokal\REASE2_Teamprojekt\REASE2\REASE2\UserControls\ucDataGrid.vb:Zeile 51.
       bei System.Windows.Controls.DataGrid.OnRowEditEnding(DataGridRowEditEndingEventArgs e)
       bei System.Windows.Controls.DataGrid.OnExecutedCommitEdit(ExecutedRoutedEventArgs e)
       bei System.Windows.Controls.DataGrid.OnExecutedCommitEdit(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
       bei System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       bei System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       bei System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       bei System.Windows.Input.RoutedCommand.Execute(Object parameter, IInputElement target)
       bei System.Windows.Controls.DataGrid.EndEdit(RoutedCommand command, DataGridCell cellContainer, DataGridEditingUnit editingUnit, Boolean exitEditMode)
       bei System.Windows.Controls.DataGrid.OnCurrentCellChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       bei System.Windows.DependencyObject.SetCurrentValueInternal(DependencyProperty dp, Object value)
       bei System.Windows.Controls.DataGrid.set_CurrentCellContainer(DataGridCell value)
       bei System.Windows.Controls.DataGrid.set_FocusedCell(DataGridCell value)
       bei System.Windows.Controls.DataGridCell.OnAnyLostFocus(Object sender, RoutedEventArgs e)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       bei System.Windows.Controls.Primitives.TextBoxBase.OnLostFocus(RoutedEventArgs e)
       bei System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.Controls.TextBox.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
       bei System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
       bei System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       bei System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
       bei System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
       bei System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
       bei System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
       bei System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       bei System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       bei System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
       bei System.Windows.UIElement.Focus()
       bei System.Windows.Controls.ScrollViewer.OnMouseLeftButtonDown(MouseButtonEventArgs e)
       bei System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       bei System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
       bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.Run()
       bei System.Windows.Application.RunDispatcher(Object ignore)
       bei System.Windows.Application.RunInternal(Window window)
       bei System.Windows.Application.Run(Window window)
       bei System.Windows.Application.Run()
       bei REASE2.Application.Main() in C:\REASE2-Projekte_lokal\REASE2_Teamprojekt\REASE2\REASE2\obj\x86\Debug\Application.g.vb:Zeile 76.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 


Do you think this is possible at all?
The exception occurs right after clicking into the add new line, before entering data at all.
(The background worker is active, btw).

Kind regards,
Nico
GeneralRe: Exception when trying to add new data while filtering is active Pin
smatusan16-May-11 8:15
membersmatusan16-May-11 8:15 
GeneralRe: Exception when trying to add new data while filtering is active Pin
Nicolai Schrade16-May-11 21:57
memberNicolai Schrade16-May-11 21:57 
PraiseRe: Exception when trying to add new data while filtering is active Pin
Dil Thapa11-May-17 2:05
memberDil Thapa11-May-17 2:05 
GeneralSetting the focus into the filter bar in code behind Pin
Nicolai Schrade10-May-11 23:02
memberNicolai Schrade10-May-11 23:02 
GeneralRe: Setting the focus into the filter bar in code behind Pin
Nicolai Schrade16-May-11 5:39
memberNicolai Schrade16-May-11 5:39 
GeneralRe: Setting the focus into the filter bar in code behind Pin
smatusan16-May-11 8:05
membersmatusan16-May-11 8:05 
GeneralRe: Setting the focus into the filter bar in code behind Pin
Nicolai Schrade16-May-11 22:13
memberNicolai Schrade16-May-11 22:13 
QuestionStackOverFlow Exception when setting UseBackgroundWorkerForFiltering to false Pin
Nicolai Schrade4-May-11 0:29
memberNicolai Schrade4-May-11 0:29 
AnswerRe: StackOverFlow Exception when setting UseBackgroundWorkerForFiltering to false Pin
smatusan4-May-11 0:51
membersmatusan4-May-11 0:51 
GeneralRe: StackOverFlow Exception when setting UseBackgroundWorkerForFiltering to false Pin
Nicolai Schrade4-May-11 2:49
memberNicolai Schrade4-May-11 2:49 
AnswerThree-State Support for Checkbox Pin
heuerm3-May-11 11:40
memberheuerm3-May-11 11:40 
GeneralRe: Three-State Support for Checkbox Pin
smatusan4-May-11 0:05
membersmatusan4-May-11 0:05 
GeneralProject in vb Pin
Member 77027442-May-11 0:26
memberMember 77027442-May-11 0:26 
GeneralRe: Project in vb Pin
smatusan2-May-11 9:19
membersmatusan2-May-11 9:19 
GeneralCombobox's column's cells don't contain data Pin
bubijohn111127-Apr-11 5:58
memberbubijohn111127-Apr-11 5:58 
GeneralRe: Combobox's column's cells don't contain data [modified] Pin
smatusan27-Apr-11 7:57
membersmatusan27-Apr-11 7:57 
GeneralRe: Combobox's column's cells don't contain data Pin
bubijohn111110-May-11 5:02
memberbubijohn111110-May-11 5:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Article
Posted 8 Sep 2009

Stats

962.8K views
20.7K downloads
160 bookmarked