Back to Devexpress

ASPxGridView.UnGroup(GridViewColumn) Method

aspnet-devexpress-dot-web-dot-aspxgridview-dot-ungroup-x28-devexpress-dot-web-dot-gridviewcolumn-x29.md

latest2.4 KB
Original Source

ASPxGridView.UnGroup(GridViewColumn) Method

Clears the grouping applied to the specified column.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public void UnGroup(
    GridViewColumn column
)
vb
Public Sub UnGroup(
    column As GridViewColumn
)

Parameters

NameTypeDescription
columnGridViewColumn

A grid column.

|

Remarks

When you call the server-side UnGroup(GridViewColumn) method, the grid behaves as follows:

  • Clears the grouping applied to the specified column.
  • Sets the column’s 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) {
    grid.UnGroup((GridViewDataColumn)grid.Columns["Country"]);
}
vb
Protected Sub grid_CustomCallback(ByVal sender As Object, ByVal e As ASPxGridViewCustomCallbackEventArgs)
    grid.UnGroup(CType(grid.Columns("Country"), GridViewDataColumn))
End Sub

See Also

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace