Xceed Grid for WinForms v4.3 Documentation
TitleFormat Property (GroupManagerRow)
Example 


Xceed.Grid.v4.3 Assembly > Xceed.Grid Namespace > GroupManagerRow Class : TitleFormat Property
Gets or sets a variable containing string representing the text displayed by the GroupManagerRow.
Syntax
'Declaration
 
<DescriptionAttribute("A variable containing string representing the text displayed by the GroupManagerRow.")>

<CategoryAttribute("Appearance")>

<AmbientValueAttribute("")>

<LocalizableAttribute(True)>

<ApplyToDesignerAttribute(True)>

Public Property TitleFormat As String
'Usage
 
Dim instance As GroupManagerRow

Dim value As String

 

instance.TitleFormat = value

 

value = instance.TitleFormat
[Description("A variable containing string representing the text displayed by the GroupManagerRow.")]

[Category("Appearance")]

[AmbientValue("")]

[Localizable(true)]

[ApplyToDesigner(true)]

public string TitleFormat {get; set;}

Property Value

A variable containing string representing the text displayed by the GroupManagerRow.

The following variables are supported by default:

%COLUMNFIELDNAME% Represents the value of both the GroupBy and FieldName properties.
%GROUPKEY% Represents the value of the Key property.
%GROUPTITLE% Represents the value of the Title property.
%DATAROWCOUNT% Represents the value returned by the GroupBase.GetSortedDataRowCount method when its recursive parameter is set to true.
%COLUMNTITLE% Represents the value of the Title property.
%COUNT: % The result of the Count statistical function.
%MAX: (see below for usage)% The result of the Maximum statistical function.
%MIN: (see below for usage)% The result of the Minimum statistical function.
%SUM: (see below for usage)% The result of the Sum statistical function.
%AVG: (see below for usage)% The result of the Average statistical function.
%STDEV: (see below for usage)% The result of the Standard Deviation statistical function.
%STDEVP: (see below for usage)% The result of the Standard Deviation Population statistical function.
%VAR: (see below for usage)% The result of the Variance statistical function.
%VARP: (see below for usage)% The result of the Variance Population statistical function.
%MEDIAN: (see below for usage)% The result of the Median statistical function.
%MODE: (see below for usage)% The result of the Mode statistical function.
%GEOMEAN: (see below for usage)% The result of the Geometric Mean statistical function.
%HARMEAN: (see below for usage)% The result of the Harmonic Mean statistical function.
%RMS: (see below for usage)% The result of the Root Mean Square statistical function.

In the case of the variables that represent statistical functions (COUNT, MAX, MIN, SUM, AVG, STDEV, STDEVP, VAR, VARP, MEDIAN, MODE, GEOMEAN, HARMEAN, and RMS), additional parameters must be provided within the variable after the colon (:). These parameters are the fieldname of the column from which the data is retrieved, the (optional) format specifier with which the result of the statistical function is displayed, and the (optional) group level for which the statistical function is calculated.

%COUNT: ["]column_fieldname["] [ format=["]format_specifier["] ] [ level=running_stat_group_level ]%

All items placed in square brackets [] are optional. If the column_fieldname and/or format_specifier parameters contain spaces, quotes must be used. If a running_stat_group_level is not specified, -1 (current group) is assumed.

The following example demonstrates how to set the TitleFormat property using statistical function variables.

groupManagerRow.TitleFormat = "A minimum of %MIN:Quantity% units were ordered at an average price of 
                              %AVG:UnitPrice format=c%.";

The format of a mathematical function depends on 2 things: the function itself and the datatype of the column whose values are used for the statistical function.

The following table provides a list of supported and unsupported format specifiers relative to the datatype of the column whose values are used for the statistical function.

Statistical function Column datatype Datatype sent to the format specifier Unsupported format specifiers
COUNT Any Int64 R
MAX, MIN, MODE Anything that implements the IComparable interface. Always the same as the datatype of the column specified by the column_fieldname parameter.
SUM Integral type* Int64 R
Floating point types** Double D and X
Decimal Decimal D, X and R
AVG, VAR, VARP, HARMEAN Integral* and Floating point** types Double D and X
Decimal Decimal D, X and R
STDEV, STDEVP, GEOMEAN, RMS Integral*, Floating point**, and Decimal types Double D and X
MEDIAN Integral type* (even item count) Double D and X
Integral type* (odd item count) Int64 R
Floating point types** Double D and X
Decimal Decimal D, X and R

* Integral types : Byte, SByte, Char, Int16, UInt16, Int32, UInt32, Int64, UInt64

** Floating point types: Single and Double

The values are rounded in the same manner as the string.Format round, meaning a banker's round.

Hint: You can use F0 instead of D. It will have the same behavior and will work for either integral types or floating point types.

Quotes can be used to specify literals in the format_specifier. For example:

groupManagerRow.TitleFormat = "%MIN:Quantity format=\"\"val: \"0.00\"%";

will result in "val: 9.00" without the quotes, for the value "9". The internal quotes are necessary when the format_specifier contains a label (ie. "val: " ).

Remarks

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

To retrieve the resolved text displayed by the GroupManagerRow, the Title property can be consulted.

To support custom variables, the GetVariableText method must be overridden.

If a % is required in the text, for example to display a percentage, then %% must be used for the text (not for the variables). Example:

groupManagerRow.TitleFormat = "The group contains %DATAROWCOUNT% datarows with 2%% containing a null value";

To reset the value of the TitleFormat property to its default value, DefaultTitleFormat, the ResetTitleFormat method must be called or the TitleFormat property set to a null reference (Nothing in Visual Basic).

Example
The following example demonstrates how to set the value of TitleFormat property in order for it to display the value which caused the group to be created and the number of datarows in the group:
groupManagerRow.TitleFormat = "Group value is COLUMNFIELDNAME and it contains DATAROWCOUNT datarows"
groupManagerRow.TitleFormat = "Group value is COLUMNFIELDNAME and it contains DATAROWCOUNT datarows";
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

GroupManagerRow Class
GroupManagerRow Members
GetVariableText Method