hi all,
i am using the groupby method and displaying a set of data looks cool ... i wud like to add upto it .... that whenever user checks a checkbox it expands all the rows or collapses
the groupbyrow is in expand state or collapsed state wen set .how it can happen at runtime
it happens initially wen the rows are initialized . thanks in advance
I am setting grouping at runtime. I have set GroupByRowInitialExpansionState to Collapsed and am also calling DisplayLayout.Rows.CollapseAll(true) after I have set the grids DataSource but the grid is still expanded to the level of the last grouped column e.g. if I am grouping by columns Strategy, Currency, Product then the first Strategy group is expanded to show all product rows. How can I disable this so that everything is initially collapsed or preferrably collapsed/expanded to the GroupByRow of the last grouped column?
Thanks in advance.
This seems to do what you want:
If boolCollapse = True Then
MyGrid.DisplayLayout.Override.GroupByRowInitialExpansionState = GroupByRowInitialExpansionState.Expanded
boolCollapse = False
Else
MyGrid.DisplayLayout.Override.GroupByRowInitialExpansionState = GroupByRowInitialExpansionState.Collapsed
boolCollapse = True
End If
You can use it on one button or devide the function between two buttons.
Hope this is sort of what you want.
Geir
thanks a lot Gier .. but is there any way to get this done directly for the entire grid as in initiliaze layout since i have more data to be groupd .
that could help me out evn better :)
You can expand rows by setting the Expanded property on the row to true.
To expand or collapse all rows, call the ExpandAll or CollapseAll method on the rows collection.
You could try this
For Each gRow As UltraGridGroupByRow In MyGrid.Rows
gRow.Expanded=true
Next
Just set it to false on another button. I haven't tested this code yet but I think it should work properly.