DataView filter

D

Duggi

Hi

I have a dataview. I would like to apply a filter on the dataview on a
column with datatype system.string. I have filter with wild char *.




I need to support wild chars * and ? in the filter expression
anywhere? How do I work around it.

Please help me to solve the same.

Thanks in advance


-Cnu
 
J

Jani Järvinen [MVP]

Hello Cnu,
I have a dataview. I need to support wild chars * and ? in the filter
expression
anywhere? How do I work around it.

As you have already noticed, the basic filtering the DataView class supports
is useful, but only takes you so long. Thus, if you need to support further
filtering, you need to write the code yourself.

Depending on your needs, you might wish to look through the rows in the
DataView, check if the field values match, and then do something with the
rows. You could use regular expressions to help with the pattern matching.

Another option would be to use LINQ to DataSet to do parts of the filtering.
I'm also sure there's already ready-made code to do the matching you need
(as it appears to match DOS wildcard matching), so do a search on the 'net.

Good luck!

--
Regards,

Mr. Jani Järvinen
C# MVP
Vantaa, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
D

Duggi

Hello Cnu,


As you have already noticed, the basic filtering the DataView class supports
is useful, but only takes you so long. Thus, if you need to support further
filtering, you need to write the code yourself.

Depending on your needs, you might wish to look through the rows in the
DataView, check if the field values match, and then do something with the
rows. You could use regular expressions to help with the pattern matching..

Another option would be to use LINQ to DataSet to do parts of the filtering.
I'm also sure there's already ready-made code to do the matching you need
(as it appears to match DOS wildcard matching), so do a search on the 'net.

Good luck!

--
Regards,

Mr. Jani Järvinen
C# MVP
Vantaa, Finland
(e-mail address removed)://www.saunalahti.fi/janij/

Thanks. I think I need to write custom filter. However, I still did
not find how to support ? as a wild char

-Cnu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top