Back to Devexpress

GridViewDataColumn.UnGroup() Method

aspnet-devexpress-dot-web-dot-gridviewdatacolumn-53bc93a8.md

latest2.2 KB
Original Source

GridViewDataColumn.UnGroup() Method

Clears the grouping applied to the column.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public void UnGroup()
vb
Public Sub UnGroup

Remarks

When you call a column’s server-side UnGroup method, the grid behaves as follows:

  • Clears the grouping applied to the column.
  • Sets the GroupIndex property to -1.

To group data by the values of a particular column on the server side, call the ASPxGridView.GroupBy or GridViewDataColumn.GroupBy method.

For more information on grouping in the grid, refer to the following topic: ASPxGridView - Group Data.

aspx
<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" KeyFieldName="CustomerID"
    OnCustomCallback="grid_CustomCallback">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="Country" VisibleIndex="0" GroupIndex="0" />
        <%--...--%>
    </Columns>
    <Settings ShowGroupPanel="true" />
</dx:ASPxGridView>
csharp
protected void grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    var column = grid.Columns["Country"] as GridViewDataColumn;
    column.UnGroup();
}
vb
Protected Sub grid_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
    Dim column = TryCast(grid.Columns("Country"), GridViewDataColumn)
    column.UnGroup()
End Sub

See Also

GridViewDataColumn Class

GridViewDataColumn Members

DevExpress.Web Namespace