GrapeCity.Win.MultiRow Namespace : SummaryCell Class |
<ToolboxBitmapAttribute()> <ValueTypeEditorAttribute(TypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", AavailableForNullValue=True)> <ToolboxItemFilterAttribute(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom Or _ ToolboxItemFilterType.Prevent Or _ ToolboxItemFilterType.Require)> <DefaultPropertyAttribute("Calculation")> <BindableCellAttribute(False)> <DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.SummaryCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")> <SRDescriptionAttribute("Displays the value which is calculated from other cell values.")> Public Class SummaryCell Inherits LabelCell
Dim instance As SummaryCell
[ToolboxBitmap()] [ValueTypeEditor(TypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", AavailableForNullValue=true)] [ToolboxItemFilter(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom | ToolboxItemFilterType.Prevent | ToolboxItemFilterType.Require)] [DefaultProperty("Calculation")] [BindableCell(false)] [Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.SummaryCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")] [SRDescription("Displays the value which is calculated from other cell values.")] public class SummaryCell : LabelCell
using System; using System.Drawing; using System.Windows.Forms; using System.Data; namespace GrapeCity.Win.MultiRow.SampleCode { public class SummaryCellDemo : Form { private GcMultiRow gcMultiRow1 = new GcMultiRow(); private Label descriptionLable = new Label(); public SummaryCellDemo() { this.Text = "SummaryCell Demo"; this.Size = new Size(550, 300); // Add MultiRow to form this.gcMultiRow1.Dock = DockStyle.Fill; this.Controls.Add(this.gcMultiRow1); descriptionLable.Height = 40; descriptionLable.BackColor = SystemColors.Info; descriptionLable.Dock = DockStyle.Bottom; descriptionLable.Text = "'Total', 'SubTotal' and 'Percentage' are SummaryCell. " + "SummaryCell can calculate cell value base on other cells' value. " + "Try to update price or add new record and watch what happened"; this.Controls.Add(descriptionLable); this.Load += new EventHandler(Form1_Load); } private void Form1_Load(object sender, EventArgs e) { // create a template with SummaryCells. TextBoxCell nameTextBox = new TextBoxCell(); NumericUpDownCell priceNumericUpDown = new NumericUpDownCell(); priceNumericUpDown.ShowSpinButton = CellButtonVisibility.NotShown; priceNumericUpDown.DecimalPlaces = 2; priceNumericUpDown.Name = "Price"; NumericUpDownCell countNumericUpDown = new NumericUpDownCell(); countNumericUpDown.ShowSpinButton = CellButtonVisibility.NotShown; countNumericUpDown.Name = "Count"; SummaryCell subTotalSummaryCell = CreateSubTotalSummaryCell(); SummaryCell percentSummaryCell = CreateCustomSummaryCell(); Cell[] cells = new Cell[] { nameTextBox, priceNumericUpDown, countNumericUpDown, subTotalSummaryCell, percentSummaryCell }; Template template1 = Template.CreateGridTemplate(cells); ColumnFooterSection columnFooter = new ColumnFooterSection(); columnFooter.Height = 21; template1.ColumnFooters.Add(columnFooter); SummaryCell totalSummaryCell = CreateTotalSummaryCell(); totalSummaryCell.Location = subTotalSummaryCell.Location; columnFooter.Cells.Add(totalSummaryCell); LabelCell totalLabelCell = new LabelCell(); totalLabelCell.Value = "Total:"; totalLabelCell.Style.Border = Border.Empty; totalLabelCell.Location = countNumericUpDown.Location; columnFooter.Cells.Add(totalLabelCell); this.gcMultiRow1.Template = template1; this.gcMultiRow1.ColumnHeaders[0][0].Value = "Name"; this.gcMultiRow1.ColumnHeaders[0][1].Value = "Price"; this.gcMultiRow1.ColumnHeaders[0][2].Value = "Count"; this.gcMultiRow1.ColumnHeaders[0][3].Value = "Sub Total"; this.gcMultiRow1.ColumnHeaders[0][4].Value = "Percentage"; this.FillValue(); }
Imports System Imports System.Drawing Imports System.Windows.Forms Imports System.Data Imports GrapeCity.Win.MultiRow Public Class SummaryCellDemo Inherits Form Private gcMultiRow1 As New GcMultiRow() Private descriptionLable As New Label() Public Sub New() Me.Text = "SummaryCell Demo" Me.Size = New Size(550, 300) ' Add MultiRow to form Me.gcMultiRow1.Dock = DockStyle.Fill Me.Controls.Add(Me.gcMultiRow1) descriptionLable.Height = 40 descriptionLable.BackColor = SystemColors.Info descriptionLable.Dock = DockStyle.Bottom descriptionLable.Text = "'Total', 'SubTotal' and 'Percentage' are SummaryCell. " + "SummaryCell can calculate cell value base on other cells' value. " + "Try to update price or add new record and watch what happened" Me.Controls.Add(descriptionLable) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load ' create a template with SummaryCells. Dim nameTextBox As New TextBoxCell() Dim priceNumericUpDown As New NumericUpDownCell() priceNumericUpDown.ShowSpinButton = CellButtonVisibility.NotShown priceNumericUpDown.DecimalPlaces = 2 priceNumericUpDown.Name = "Price" Dim countNumericUpDown As New NumericUpDownCell() countNumericUpDown.ShowSpinButton = CellButtonVisibility.NotShown countNumericUpDown.Name = "Count" Dim subTotalSummaryCell As SummaryCell = CreateSubTotalSummaryCell() Dim percentSummaryCell As SummaryCell = CreateCustomSummaryCell() Dim cells As Cell() = New Cell() {nameTextBox, priceNumericUpDown, countNumericUpDown, subTotalSummaryCell, percentSummaryCell} Dim template1 As Template = Template.CreateGridTemplate(cells) Dim columnFooter As New ColumnFooterSection() columnFooter.Height = 21 template1.ColumnFooters.Add(columnFooter) Dim totalSummaryCell As SummaryCell = CreateTotalSummaryCell() totalSummaryCell.Location = subTotalSummaryCell.Location columnFooter.Cells.Add(totalSummaryCell) Dim totalLabelCell As New LabelCell() totalLabelCell.Value = "Total:" totalLabelCell.Style.Border = Border.Empty totalLabelCell.Location = countNumericUpDown.Location columnFooter.Cells.Add(totalLabelCell) Me.gcMultiRow1.Template = template1 Me.gcMultiRow1.ColumnHeaders(0)(0).Value = "Name" Me.gcMultiRow1.ColumnHeaders(0)(1).Value = "Price" Me.gcMultiRow1.ColumnHeaders(0)(2).Value = "Count" Me.gcMultiRow1.ColumnHeaders(0)(3).Value = "Sub Total" Me.gcMultiRow1.ColumnHeaders(0)(4).Value = "Percentage" Me.FillValue() End Sub
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
GrapeCity.Win.MultiRow.Cell
GrapeCity.Win.MultiRow.LabelCell
GrapeCity.Win.MultiRow.SummaryCell
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