Intersoft WebGrid Documentation
OnCustomAggregate Method
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : OnCustomAggregate Method






col
The WebGridColumn object.
rows
The WebGridRowCollection object.
type
The type of the rows object.
Invoked when the AggregateFunction of WebGridColumn is set to Custom. This event will be invoked on every Rows collection of GroupedRows if exist.

Syntax

Visual Basic (Declaration) 
Public Overridable Function OnCustomAggregate( _
   ByVal col As WebGridColumn, _
   ByVal rows As WebGridRowCollection, _
   ByVal type As String _
) As Object
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim col As WebGridColumn
Dim rows As WebGridRowCollection
Dim type As String
Dim value As Object
 
value = instance.OnCustomAggregate(col, rows, type)
C# 
public virtual object OnCustomAggregate( 
   WebGridColumn col,
   WebGridRowCollection rows,
   string type
)
Delphi 
public function OnCustomAggregate( 
    col: WebGridColumn;
    rows: WebGridRowCollection;
    type: String
): TObject; virtual; 
JScript 
public function OnCustomAggregate( 
   col : WebGridColumn,
   rows : WebGridRowCollection,
   type : String
) : Object;
Managed Extensions for C++ 
public: virtual Object* OnCustomAggregate( 
   WebGridColumn* col,
   WebGridRowCollection* rows,
   string* type
) 
C++/CLI 
public:
virtual Object^ OnCustomAggregate( 
   WebGridColumn^ col,
   WebGridRowCollection^ rows,
   String^ type
) 

Parameters

col
The WebGridColumn object.
rows
The WebGridRowCollection object.
type
The type of the rows object.

Example

 
The example below shows how to use CustomAggregate method.
C#Copy Code
private void WebGrid1_CustomAggregate(object sender,
ISNet.WebUI.WebGrid.CustomAggregateArgs e)
{
    if (e.Column.DataMember == "UnitsOnOrder") 
    {
        WebGridRowCollection rows = e.Rows;
        int count = 0;
        for (int i=0; i < rows.Count; i++) 
        {
            WebGridCell cell = rows[i].Cells[e.Column.Position];
            if (int.Parse( cell.Value.ToString() ) > 0) count++;
        }
        e.AggregateResult = count;
    }
}

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.