I have created a custom header for my datagrid with textboxes and other controls, to allow a user to be able to filter on a particular column. Because I am creating a multi filter in code behind, I need to gain access not only to the controls value that
is being updated, but also any other of the column header controls that may still contain content to be filtered on. Here is some of my markup...
Right now in code behind I am handling the textbox changed events by assigning the values to a class member in code behind like so...
string PACSValue =
string InstitutionValue =
CollectionViewSource view =
void FilterChanged(object sender,
if (this.pacsItems ==
PACSValue = ((
view.Filter -= PACSFilter;
view.Filter += PACSFilter;
As you can see, what I did was create a class member in code behind for each of my filter controls and set the value when the text changed event is raised. Although this approach works fine, I would think accessing the controls values
directly within my filters would be better than having to create global class members as I did. Is there a simple way to gain access to the controls in the header template?