Hello
What is the recommended way to hide a data-bound (ObservableCollection) gridView entirely when it has no items to be displayed? I want to avoid the effect of only having a grid header, but no data rows below it.
With Q1-2010, I'm using this code:
gridView.Visibility = (gridView.Items.Count > 0) ? Visibility.Visible : Visibility.Collapsed;
but I don't know when (i.e. in which event handler) one has to call it. I tried the "DataLoaded" event, but this one does not seem to fire when no data at all is in the grid. And "DataLoading" seems not to fire at all (what is this for???). And the inherited "Loaded" event seems to be the wrong time, because the information what data will be in the gridView is not present at this time.
Any hints?
Regards,
Björn
What is the recommended way to hide a data-bound (ObservableCollection) gridView entirely when it has no items to be displayed? I want to avoid the effect of only having a grid header, but no data rows below it.
With Q1-2010, I'm using this code:
gridView.Visibility = (gridView.Items.Count > 0) ? Visibility.Visible : Visibility.Collapsed;
but I don't know when (i.e. in which event handler) one has to call it. I tried the "DataLoaded" event, but this one does not seem to fire when no data at all is in the grid. And "DataLoading" seems not to fire at all (what is this for???). And the inherited "Loaded" event seems to be the wrong time, because the information what data will be in the gridView is not present at this time.
Any hints?
Regards,
Björn