Datagrid: function scope bug fixed