Sub-totals can be added for a column using the TotalBreak property in combination with the Aggregate property. Duplicated column values can be suppressed using ClearDuplicateValue property.

Razor
    
DbNetGridCore orderTotalsGrid = new DbNetGridCore("northwind", "Customers join Orders on Customers.CustomerID = Orders.CustomerID join [Order Details] on Orders.OrderID = [Order Details].OrderID");
orderTotalsGrid.Columns = new List() { "CompanyName", "OrderDate", "[Order Details].OrderID", "ProductID", "UnitPrice", "Quantity", "(UnitPrice*Quantity) as Value" };
orderTotalsGrid.Labels = new List() {  "Company", "Order Date", "Order ID", "Product", "Unit Price", "Qty", "Value" };
orderTotalsGrid.SetColumnProperty("UnitPrice", ColumnPropertyType.Format, "c");
orderTotalsGrid.SetColumnProperty("value", ColumnPropertyType.Format, "c");
orderTotalsGrid.SetColumnProperty("value", ColumnPropertyType.DataType, nameof(Decimal));
orderTotalsGrid.SetColumnProperty("value", ColumnPropertyType.Aggregate, AggregateType.Sum);
orderTotalsGrid.SetColumnProperty(new string[] { "CompanyName", "OrderID" }, ColumnPropertyType.TotalBreak, true);
orderTotalsGrid.SetColumnProperty(new string[] { "OrderDate" }, ColumnPropertyType.ClearDuplicateValue, true);

    orderTotalsGrid.SetColumnProperty("ProductID", ColumnPropertyType.Lookup, new Lookup("Products", "ProductId", "ProductName"));
@orderTotalsGrid.Render()