Intersoft WebGrid Documentation
CustomAggregateArgs Class
Members  Example  See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace : CustomAggregateArgs Class






Class that allow users to perform custom calculation on Rows collection.

Object Model

CustomAggregateArgs Class

Syntax

Visual Basic (Declaration) 
Public Class CustomAggregateArgs 
   Inherits BaseEventArgs
Visual Basic (Usage)Copy Code
Dim instance As CustomAggregateArgs
C# 
public class CustomAggregateArgs : BaseEventArgs 
Delphi 
public class CustomAggregateArgs = class(BaseEventArgs)
JScript 
public class CustomAggregateArgs extends BaseEventArgs
Managed Extensions for C++ 
public __gc class CustomAggregateArgs : public BaseEventArgs 
C++/CLI 
public ref class CustomAggregateArgs : public BaseEventArgs 

Example

 

The following sample codes show you how to implement aggregate calculation by handling the CustomAggregate event.
C#Copy Code
private void WebGrid1_CustomAggregate(object sender,
ISNet.WebUI.WebGrid.CustomAggregateArgs e)

{

    if (e.Column.DataMember == "Status") 
    {
        WebGridRowCollection rows = e.Rows;
        int count = 0;
        for (int i=0; i < rows.Count; i++) 
        {
            WebGridCell cell = rows[i].Cells[e.Column.Position];
            if (cell.Value.ToString() == "Active")
            {
                count++;
            }
        }
        e.AggregateResult = count;
    }
}

Remarks

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

Note that you can specify the CustomAggregate to as much columns as you want, the CustomAggregate event will be invoked each time the WebGrid found the specified CustomAggregate Column in the rendering process.

Inheritance Hierarchy

System.Object
   System.EventArgs
      ISNet.WebUI.WebGrid.BaseEventArgs
         ISNet.WebUI.WebGrid.CustomAggregateArgs

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.