Home Forums WinForms controls Xceed Grid for WinForms Summary Row/Cells Reply To: Summary Row/Cells

Xceed Support
Member
Post count: 5658

You need to assign the “Total” string, to the second cell and consider the first cell as empty.

Here is a snippet that shows how to implement that.

<code>
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
For j As Integer = 0 To 3
Dim col As New Column(“Column” + j.ToString(), GetType(Integer))
gridControl1.Columns.Add(col)
Next
For i As Integer = 0 To 19

Dim row As Xceed.Grid.DataRow = gridControl1.DataRows.AddNew()
For Each cell As Cell In row.Cells
cell.Value = i * 10
Next
row.EndEdit()
Next

Dim sumRow As New SummaryRow()
gridControl1.FixedFooterRows.Add(sumRow)

DirectCast(sumRow.Cells(“Column1”), SummaryCell).TitleFormat = “Total”
DirectCast(sumRow.Cells(“Column1”), SummaryCell).TitlePosition = TitlePosition.AlwaysLeft
DirectCast(sumRow.Cells(“Column1”), SummaryCell).StatFunction = StatFunction.Sum
DirectCast(sumRow.Cells(“Column2”), SummaryCell).StatFunction = StatFunction.Sum
DirectCast(sumRow.Cells(“Column3”), SummaryCell).StatFunction = StatFunction.Sum
End Sub
</code>

Imported from legacy forums. Posted by CharlesB (had 392 views)