How to detect hidden rows?

  • Thread starter Thread starter Benton
  • Start date Start date
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
 
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.
 
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
 
Back
Top