D
David Hirschfeld
I am trying to create a user enterable filter for a
datagrid that has a little intelligence. I would like
the filter to be capable of the following type of matches:
For this application, the datagrid displays a list of
Parts with PartID as the key. An example of a PartID is
12345-B11. When a user enters a filter value in an
attempt to reduce the datagrid to similar PartIDs they
may enter the PartID as 12345B11. How do I enter an
DataView.RowFilter(expression) to accomplish this? The
obvious expression would be the following (which works
fine as a SQL Query), but the .NET Framework doesn't
support the SQL Replace function:
"Replace(PartID, '-', '') LIKE '%XXXXXX%'"
With Query Analyzer, this produces the desired result.
How do I accomplish this with a DataView? I would like
to avoid either 1) Adding a new column to the DataView
which stores the value = Replace(PartID, '-', '') or 2)
spin through the DataView copying the desired rows one at
a time to a new DataTable.
datagrid that has a little intelligence. I would like
the filter to be capable of the following type of matches:
For this application, the datagrid displays a list of
Parts with PartID as the key. An example of a PartID is
12345-B11. When a user enters a filter value in an
attempt to reduce the datagrid to similar PartIDs they
may enter the PartID as 12345B11. How do I enter an
DataView.RowFilter(expression) to accomplish this? The
obvious expression would be the following (which works
fine as a SQL Query), but the .NET Framework doesn't
support the SQL Replace function:
"Replace(PartID, '-', '') LIKE '%XXXXXX%'"
With Query Analyzer, this produces the desired result.
How do I accomplish this with a DataView? I would like
to avoid either 1) Adding a new column to the DataView
which stores the value = Replace(PartID, '-', '') or 2)
spin through the DataView copying the desired rows one at
a time to a new DataTable.