Data Grid columns are updated when the columns attribute itself is set. So you can tell Anvil to update the columns by doing:
self.data_grid_1.columns = self.data_grid_1.columns
So this is one way to change a column’s width:
self.data_grid_1.columns[0]['width'] = 500
self.data_grid_1.columns = self.data_grid_1.columns
https://anvil.works/ide#clone:OHUUBRJDH224V7WH=B7AIGBSM7AFVHQW4CR36ABEF
I’m not quite clear on what you mean about using DataRowPanels in a tree like structure. Would they use the same columns, but be indented, or would they use different columns?
You may be able to achieve what you want by putting a Data Grid in the RepeatingPanel of an outer Data Grid, as shown in this somewhat abstract example:
https://anvil.works/ide#clone:NBDAWQMAXMVGXYSX=7ZO55AO6KXZ3F45IRTSHUDP2
I’ve set the inner Data Grid to have no column headers or page controls - obviously whether or not you keep them depends on the specific application.
