Xceed Grid for WinForms v4.3 Documentation
StatFieldName Property
Example 


Xceed.Grid.v4.3 Assembly > Xceed.Grid Namespace > SummaryCell Class : StatFieldName Property
Gets or sets the fieldname of the column whose values are to be used to calculate the StatFunction.
Syntax
'Declaration
 
<DescriptionAttribute("The fieldname of the column whose values are to be used to calculate the StatFunction.")>

<CategoryAttribute("Data")>

<RefreshPropertiesAttribute(RefreshProperties.All)>

<ApplyToDesignerAttribute(True)>

<TypeConverterAttribute("Xceed.Grid.Design.StatFieldNameConverter,Xceed.Grid.v4.3.Design,Version=4.3.20076.12375,Culture=neutral,PublicKeyToken=ba83ff368b7563c6")>

Public Property StatFieldName As String
'Usage
 
Dim instance As SummaryCell

Dim value As String

 

instance.StatFieldName = value

 

value = instance.StatFieldName
[Description("The fieldname of the column whose values are to be used to calculate the StatFunction.")]

[Category("Data")]

[RefreshProperties(RefreshProperties.All)]

[ApplyToDesigner(true)]

[TypeConverter("Xceed.Grid.Design.StatFieldNameConverter,Xceed.Grid.v4.3.Design,Version=4.3.20076.12375,Culture=neutral,PublicKeyToken=ba83ff368b7563c6")]

public string StatFieldName {get; set;}

Property Value

The Column.FieldName of the column whose values are to be used to calculate the StatFunction. By default, DefaultStatFieldName.
Remarks

The statistics for a column other than the SummaryCell's parent column can be calculated and displayed in the cell by setting the StatFieldName property. The StatFieldName property indicates for which column the statistics will be calculated.

In the case where the column fieldname specified by the StatFieldName property does not exist, "#InvalidStatFieldName#" will be displayed rather than the statistical result, where "InvalidStatFieldName" represents the string passsed to the StatFieldName property.

Example
The following example demonstrates how to calculate the average value of the "Quantity" column and display the result in the "UnitPrice" SummaryCell.
SummaryCell unitPrice = ( SummaryCell )sumRow.Cells[ "UnitPrice" ];



unitPrice.StatFieldName = "Quantity";

unitPrice.StatFunction = StatFunction.Average;

unitPrice.TitleFormat = "The average ordered quantity is: ";
Dim unitPrice As SummaryCell = CType( sumRow.Cells( "UnitPrice" ), SummaryCell )



unitPrice.StatFieldName = "Quantity"

unitPrice.StatFunction = StatFunction.Average

unitPrice.TitleFormat = "The average ordered quantity is: "
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SummaryCell Class
SummaryCell Members