KUIB 3.0 - 'Data Bound' event function for a Data Grid view - Forum - Kendo UI Builder - Progress Community

KUIB 3.0 - 'Data Bound' event function for a Data Grid view

 Forum

KUIB 3.0 - 'Data Bound' event function for a Data Grid view

This question is answered

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?

Verified Answer
  • 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
All Replies
  • 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!