'宣言 Public ReadOnly Property SummaryDefinition As SummaryDefinition
public SummaryDefinition SummaryDefinition {get;}
このプロパティは、関連付けられた SummaryDefinition オブジェクトを返します。実際に集計を指定する方法については、FieldLayout.SummaryDefinitions プロパティを参照してください。
Imports Infragistics.Windows Imports Infragistics.Windows.Editors Imports Infragistics.Windows.DataPresenter Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) ' Set the data source. _dp.DataSource = _dataSource Dim summaryDef1 As SummaryDefinition = _dp.FieldLayouts(0).SummaryDefinitions.Add( _ "PriceAverage", SummaryCalculator.Average, "Price") ' All summary results associated with this summary definition will use this ' tool-tip. summaryDef1.ToolTip = "Price Average" ' Add a second summary that gets used in dp_SummaryResultChanged below. Dim summaryDef2 As SummaryDefinition = _dp.FieldLayouts(0).SummaryDefinitions.Add( _ "PriceTotal", SummaryCalculator.Sum, "Price") End Sub ' If the tool-tip needs to be based on the summary result value, you can ' set the ToolTip on the SummaryResult object itself. For that hook into ' SummaryResultChanged event and set the ToolTip on the SummaryResult object ' based on the calculated result value. Private Sub Dp_SummaryResultChanged(ByVal sender As Object, ByVal e As Infragistics.Windows.DataPresenter.Events.SummaryResultChangedEventArgs) Dim result As Object = e.SummaryResult.Value If e.SummaryResult.SummaryDefinition.Key = "PriceTotal" Then e.SummaryResult.ToolTip = String.Format("Price Total is {0:c}", result) End If End Sub
using Infragistics.Windows; using Infragistics.Windows.Editors; using Infragistics.Windows.DataPresenter; public void Window1_Loaded( object sender, RoutedEventArgs e ) { _dp.DataSource = _dataSource; SummaryDefinition summaryDef1 = _dp.FieldLayouts[0].SummaryDefinitions.Add( "PriceAverage", SummaryCalculator.Average, "Price" ); // All summary results associated with this summary definition will use this // tool-tip. summaryDef1.ToolTip = "Price Average"; // Add a second summary that gets used in dp_SummaryResultChanged below. SummaryDefinition summaryDef2 = _dp.FieldLayouts[0].SummaryDefinitions.Add( "PriceTotal", SummaryCalculator.Sum, "Price" ); } // If the tool-tip needs to be based on the summary result value, you can // set the ToolTip on the SummaryResult object itself. For that hook into // SummaryResultChanged event and set the ToolTip on the SummaryResult object // based on the calculated result value. public void dp_SummaryResultChanged( object sender, Infragistics.Windows.DataPresenter.Events.SummaryResultChangedEventArgs e ) { object result = e.SummaryResult.Value; if ( e.SummaryResult.SummaryDefinition.Key == "PriceTotal" ) { e.SummaryResult.ToolTip = string.Format( "Price Total is {0:c}", result ); } }