I am using Boa constructor and python2.3
I have a grid with lets say 3 columns and 25 rows and all the cells have numbers
I want to add contents of column 1 and display in textctrl1, total of column 2 in text ctrl 2 and total of column 3 in textctrl3
What i am doing right now is as follows
I repeat the same process for column 2 and column 3 and assign them to textctrl2 and textctrl3 respectively
But If I want to do the following how do i assign the totals to the respective text ctrl
I have a grid with lets say 3 columns and 25 rows and all the cells have numbers
I want to add contents of column 1 and display in textctrl1, total of column 2 in text ctrl 2 and total of column 3 in textctrl3
What i am doing right now is as follows
Code:
Number_of_rows_Grid1 = self.grid1.GetNumberRows() total = 0 for all_rows_in_grid1 in range (0,Number_of_rows_Grid1): cell_value = self.grid1.GetCellValue(all_rows_in_grid1, 1) total = total + cell_value string_total = str(total) self.textCtrl1.Value = string_total
But If I want to do the following how do i assign the totals to the respective text ctrl
Code:
Number_of_rows_Grid1 = self.grid1.GetNumberRows() total = 0 for all_columns_in_grid1 in range (0,3): for all_rows_in_grid1 in range (0,Number_of_rows_Grid1): cell_value = self.grid1.GetCellValue(all_rows_in_grid1, 1) total = total + cell_value string_total = str(total)
Comment