Select rows in data grid for update

Hi all,

Can anyone tell me how to go about adding a checkbox to a data grid that can be used to differentiate which rows in the data grid need to be updated.

The use case:
I have a data grid that is populated by rows in a table and I would like to be able to select which tables will be updated via a server function when you click a button. Currently I have the check box in the RowTemplate with no data bindings but cannot work out how to read the state of the checkbox in the rows when the button update button is clicked.

I do not want to use the change event on the checkbox to run the server function as it would not be required if the user cancelled the operation.

Thank you in advance.

Rick

If I understand you correctly, you want to step through each row and identify the rows that have the checked check boxes. If so, this should do the trick :

# Step through each template form (row) in the repeating panel.
for r in self.repeating_panel_1.get_components():
  # Step through all the components that make up the row.
  for c in r.get_components():
    if type(c) is CheckBox:
      print(c.checked)
7 Likes

Once again, Thank you @david.wylie, looks like I owe you a beer!

Nested for loop for the win :slight_smile:

1 Like