c# - How to set a max rows on Telerik Grid (MVC, Razor) -
is there way set maximum of rows on telerik grid?
for example, want let customer introduce 15 rows max or minimum of 1 or throwing error maximum "x".
i found out how solve this.
.clientevents(x => { x.onedit("checkrows"); x.ondelete("checkrows"); }) <script> function checkrows(e) { var grid = $('#grid').data('tgrid'); var button = $("#grid .t-grid-toolbar .t-grid-add"); if (grid.inserteddataitems().length - grid.deleteddataitems().length > 15) { button.hide(); } else { button.show(); } } </script>
Comments
Post a Comment