How to detect hidden rows?

B

Benton

Hi there,

Is there a way to know if a DataRow is hidden by an active
DefaultView.Filter of its DataTable? In other words, is there any way to
know if a specific DataRow will be iterated too ("visible") when iterating
the DataRowView collection of the filtered DataView?

Regards,

-Benton
 
W

W.G. Ryan - MVP

Hi Benton:
Benton said:
Hi there,

Is there a way to know if a DataRow is hidden by an active
DefaultView.Filter of its DataTable? In other words, is there any way to
know if a specific DataRow will be iterated too ("visible") when iterating
the DataRowView collection of the filtered DataView?
--If I understand your question correctly, the answer is 'no'. You see,
when you use a Rowfitler, a new DataView object is created and rows that
don't meet the filter condition are simply excluded from the view. It's not
the most efficient thing to do but you can create a second view based on the
inverse of your filter criteria - this would give you all of the rows that
were filtered out in your first pass.
 
C

Cor Ligthert [MVP]

It's not the most efficient thing to do but you can create a second view
based on the inverse of your filter criteria - this would give you all of
the rows that were filtered out in your first pass.

Why not efficient. Efficient is the best method that fits the goal, in my
case do you describe that well.

(You mean probably not forever the most easiest way if the rowfilter is
complex)

I think that there are other methods however those are in my opinion less
efficient. One of those is looping through the datatable and use the
dataview.find than if it exist in the dataview.

:)

Cor
 

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