Using buttons inside a repeating panel

Hi all,

I’ve created a datagrid (“School_Data_Datagrid”) with 7 columns inside a Form called “Main_Page”. The datagrid has a repeating panel within it called “School_Data_Repeating_Panel”

I have a button I click outside that form called “Populate_Data”

The first 6 rows are simply text data with the 7th row being made of 4 buttons. Those 4 buttons do something to my database that is specific to the row.

To create those 4 buttons I double clicked on the repeating panel and it created a sub-form I called "School_Data_Data_Panel where I put the 4 buttons into the final column. I did nothing to the other columns.

When I press “Populate_Data” I’m able to populate the first 6 columns no problem and am passing the data to the 7th column (in the hopes of accessing it from the buttons).

I am unable to hand any data to those buttons.

Realistically I can cope with ‘pulling’ the data when the buttons are pressed however when I access self.parent.items I am getting all the data from the whole datagrid. I want to ensure that the button only pulls the data for it’s corresponding row.

Thanks.

Just to add I’m pulling the parent items using self.parent.items. If there was a way I could know which row the button belonged to I could then do self.parent.items[row] to get the right row data.

This should be equivalent to self.item.

Please have a look at this tutorial: Anvil | Data Grids: Displaying Data In Tables

The last step should show what you are looking for.

2 Likes

My word.

I cannot believe how simple this was! Thank you so much.

1 Like