I have a databound grid control which I need to simply add a summary row with a SUM cell for each column, except the first, which should be the text “Total:”. I can’t figure out how to go about doing this and have searched the forums and the docs. Will someone provide some logic or code for me? I’m using VB.NET.
Imported from legacy forums. Posted by Drew (had 2572 views)
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)