Is it possible to hide the expansion indicator on the parent row in a multiband grid if all of the child rows have been filtered out?
I have a grid which is loaded with a dataset containing two tables and a relation is then added. Outside the grid, there are two date selectors. The child rows are filtered based on the dates in the date selectors. I would like the expansion indicator on the parent row to be hidden if all the child rows are filtered out. I have the expansion indicator set to CheckOnExpand in the InitializeLayout event on the grid, but that doesn't achieve what I want.
As you can see, the expansion indicator is showing next to row 1, even though all the child rows are filtered out. Please let me know if there is a way to hide it.
Note that I am filtering using the following code:
gridFlights.DisplayLayout.Bands(1).ColumnFilters.ClearAllFilters() gridFlights.DisplayLayout.Bands(1).ColumnFilters("OriginationDate").FilterConditions.Add(FilterComparisionOperator.GreaterThanOrEqualTo, DateFrom.Value) gridFlights.DisplayLayout.Bands(1).ColumnFilters("OriginationDate").FilterConditions.Add(FilterComparisionOperator.LessThanOrEqualTo, DateTo.Value)
Thank you.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Me.UltraGrid1.DisplayLayout.Bands(1).ColumnFilters.ClearAllFilters() Me.UltraGrid1.DisplayLayout.Bands(1).ColumnFilters("Column 0").FilterConditions.Add(FilterComparisionOperator.Contains, 3) For Each row As UltraGridRow In Me.UltraGrid1.Rows If row.ChildBands(0).Rows.FilteredInNonGroupByRowCount.Equals(0) Then row.ExpansionIndicator = ShowExpansionIndicator.Never row.ChildBands(0).Rows.CollapseAll(True) row.Expanded = False End If Next End Sub
Thank you. That worked.