M
Mohammed Siraj
Guest
Hello Peter, At the onset, thank you for your positive feedback. GridControl fields/columns are driven by GridControl component definition. Dynamically hiding GridColumn columns is NOT a supported use-case. However, you can still considering leveraging Client-side SDK & applying this client-side override on form pages with GridControl. This should work for all the basis cases where in the following constraints are not violated: Required Field Column Field ( column that is to be hidden) is used to derieve value of anything Field in GridControl eg. Dependent Picklist or Dependent Lookup Eg: To hide second column on first grid control in the page: function hideGridControlColumn(gridControlIndex, columnIndex) { var gridControl = rbf_getGridControlComponent(gridControlIndex); if (!gridControl) { throw 'GridControl at index: ' + gridControlIndex + ' not found\n'; } var columnCount = gridControl.getCellData().fields.length; if (columnIndex >= 0 && columnIndex < columnCount) { gridControl.getKendoConfig().hideColumn(columnIndex + 1); gridControl.getCellData().fields = gridControl.getCellData().fields.filter(function (i, j) { return j != columnIndex; }); } else { throw 'Column Index invalid: ' + columnIndex; } } //To hide First GridControl's second column hideGridControlColumn(0, 1); // hideGridControlColumn(gridControlIndex, columnIndex) Request you to try out the above utility function and see if it meets your requirements. Please note, the above snippet is shared only as an example and is not an in-built feature in product.
Continue reading...
Continue reading...