Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can display the sum for values within a column?

column display values
0
Posted

How can display the sum for values within a column?

0

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(

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123