How to apply a custom rowfilter to a DataView

  • Thread starter =?ISO-8859-1?Q?Marcel_M=FCller?=
  • Start date
?

=?ISO-8859-1?Q?Marcel_M=FCller?=

Hi,

I want to implement a custom RowFilter to select rows from a DataTable.
(In fact a regex match).

Unfortunately I could not find a way to do this.

I consider to delete table rows temporarily. But this is a very bad
solution, because it interferes with the RowState logic of the DataTable.


Marcel
 
M

Miha Markic

Marcel Müller said:
Hi,

I want to implement a custom RowFilter to select rows from a DataTable.
(In fact a regex match).

Unfortunately I could not find a way to do this.

I consider to delete table rows temporarily. But this is a very bad
solution, because it interferes with the RowState logic of the DataTable.

Yes, there is no way to do it normally.
You could remove rows from table temporarily though.
Note that removing is not deleting and it will not interfere with RowState
whatsoever.

Or you might create a proxy object (a class that acts like dataview) which
should be a bit of a big task.
 
?

=?ISO-8859-1?Q?Marcel_M=FCller?=

Hi,

Yes, there is no way to do it normally.
You could remove rows from table temporarily though.
Note that removing is not deleting and it will not interfere with RowState
whatsoever.

Not that helpful, since a Remove will drop the data immediately.
Or you might create a proxy object (a class that acts like dataview) which
should be a bit of a big task.

I tried to derive from dataview. However, without success.
Many of the Methods, like GetEnumerator, are not virtual and can't be
overloaded.

It seems to be a limit of the ADO concept. I wonder that this is not a
very common issue. Since the power of the SQL expressions is rather poor.


Marcel
 
M

maciek kanski

I want to implement a custom RowFilter to select rows from a DataTable.
(In fact a regex match).
What about adding a bool column, manually setting to true or false (according to
regex matching) and showing only rows with true in this additional column?
It should work since U don't have to use all the columns and computing regex can
be automatically done in DataTable->onColumnChanging - if I didn't miss anything
it seems to be easy:)

Regards
 

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