Intersoft WebGrid Documentation
AggregateResult Property
See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace > CustomAggregateArgs Class : AggregateResult Property






Set the result of the aggregate function.

Syntax

Visual Basic (Declaration) 
Public Property AggregateResult As Object
Visual Basic (Usage)Copy Code
Dim instance As CustomAggregateArgs
Dim value As Object
 
instance.AggregateResult = value
 
value = instance.AggregateResult
C# 
public object AggregateResult {get; set;}
Delphi 
public read-write property AggregateResult: TObject; 
JScript 
public function get,set AggregateResult : Object
Managed Extensions for C++ 
public: __property Object* get_AggregateResult();
public: __property void set_AggregateResult( 
   Object* value
);
C++/CLI 
public:
property Object^ AggregateResult {
   Object^ get();
   void set (    Object^ value);
}

Example

The following sample shows you how to perform calculation using CustomAggregate event

[C#]

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;
    }
}

Remarks

The provided aggregation functions such as Count, Sum, Average, Min and Max are generally applicable to most application's requirements. However, it doesn't allow you to perform your own calculation on the grouped rows or footer's totaling.

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.