2007-09-28, 16:53
I have a tv episodes view (based around a list control) where I would like to show some text if there are no episodes displayed (it should be better than just showing an empty space). I thought I would try and do this by checking the Control.IsVisible value for the list.
If I am looking at the view for a tv show that has no episodes then IsVisible returns false and I can display my message. However if I'm looking at a tv show which does have episodes but none are displayed in the list (because of the watched/unwatched filter) then IsVisible returns true.
I can kind of understand why it works like this (the list is not created at all if the show has no episodes I presume?) but would it make sense to also have IsVisible return false if the list is not displaying any items? Alternatively is there another function (such as List.HasItems) that could be used to work out if anything is being displayed or not?
If I am looking at the view for a tv show that has no episodes then IsVisible returns false and I can display my message. However if I'm looking at a tv show which does have episodes but none are displayed in the list (because of the watched/unwatched filter) then IsVisible returns true.
I can kind of understand why it works like this (the list is not created at all if the show has no episodes I presume?) but would it make sense to also have IsVisible return false if the list is not displaying any items? Alternatively is there another function (such as List.HasItems) that could be used to work out if anything is being displayed or not?