How can display the sum for values within a column?
The following samples add the values from a column with 20000 rows/cells, and get the sum displayed on a locked item on the bottom side: 1. The following sample adds the locked item before adding rows, with initial value 0, and computes the sum progressively: Dim iChange As Long Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant) If (iChange = 0) Then iChange = iChange + 1 With Grid1.Items h = .LockedItem(exBottom, 0) ‘ Removes the OldValue, and adds the NewValue .CellValue(h, 0) = .CellValue(h, 0) – .CellValue(Item, ColIndex) + NewValue End With iChange = iChange – 1 End If End Sub Private Sub Form_Load() iChange = 0 With Grid1 .BeginUpdate .FullRowSelect = exColumnSel .Columns.Add(“Value”).Editor.EditType = 1 With .Items ‘ Adds the divider item that displays the sum .LockedItemCount(exBottom) = 1 h = .LockedItem(exBottom, 0) .ItemDivider(h) = 0 .ItemDividerLineAlignment(h) = DividerTop .CellHAlignment(h) = RightAlignment .CellValue(