aspnet-devexpress-dot-web-dot-gridviewdatacolumn-21ee5018.md
Groups data by the values of the current column.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public void GroupBy()
Public Sub GroupBy
Call a column’s server-side GroupBy method to group data in the grid by this column’s values.
To clear grouping applied to a particular column on the server side, call the ASPxGridView.UnGroup or GridViewDataColumn.UnGroup method.
For more information on grouping in the grid, refer to the following topic: ASPxGridView - Group Data.
<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False" KeyFieldName="CustomerID">
<Columns>
<dx:GridViewDataTextColumn FieldName="Country" VisibleIndex="0" />
<%--...--%>
</Columns>
<Settings ShowGroupPanel="true" />
</dx:ASPxGridView>
protected void Page_Load(object sender, EventArgs e) {
var column = grid.Columns["Country"] as GridViewDataColumn;
column.GroupBy();
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim column = TryCast(grid.Columns("Country"), GridViewDataColumn)
column.GroupBy()
End Sub
See Also