ListBox and sum

Hi guys, I have a screen with a ListBox. Populated with values. Is there a way to have an immediate sum of a column for all the rows of the table, without having to read one row at a time in a loop?

if your values come from a database, you can query the sum directly from the database
otherwise, calculate the sum while filling the listbox with values.

Thanks