If I drag a grid onto a Blank view I can set the "Data Bound Event Function" property, but in the Data Grid view that property is not available. I assume there's a way to have code run when data is bound in a Data Grid view though. Can anyone show me how to do that?
Hi,
Indeed the DataGridView does not have exposed grid's DataBound event in the designer. In order to run the code when this event is fired you need to bind to it manually in the onShow event handler:
// Fired when view content is loaded onShow($scope) { console.log('Show'); this.$scope.$watch(() => { return this.$grid; }, (newValue, oldValue) => { if (newValue) { this.$grid.bind('dataBound', (e) => { alert('dataBound'); }); } }); }
Best,
Rado
Hi,
Indeed the DataGridView does not have exposed grid's DataBound event in the designer. In order to run the code when this event is fired you need to bind to it manually in the onShow event handler:
// Fired when view content is loaded onShow($scope) { console.log('Show'); this.$scope.$watch(() => { return this.$grid; }, (newValue, oldValue) => { if (newValue) { this.$grid.bind('dataBound', (e) => { alert('dataBound'); }); } }); }
Best,
Rado
Thanks!