This is a migrated thread and some comments may be shown as answers.

[Solved] is it possible to disable the EDIT/DELETE buttons for specific rows in the Grid?

0 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 07 Feb 2012, 10:17 PM

Hi all,

My models contains an extra field (bit) which specifies a value of 0 or 1.
If the row contains a value of 0 (zero), I don't want to display the EDIT/DELETE buttons on my grid row.
Is that possible to achieve? it would be something like:

.ClientEvents(events => events.OnDataBinding("Grid_onDataBinding"))

<script type="text/javascript">
function Grid_onDataBinding(e){

        var grid = $('#Grid').data('tGrid');
        hasAdminRights = e.row.cells[9].innerHTML; //get value of field which is 0 or 1
 
        if (hasAdminRights = 0) {
              //hide EDIT/DELETE buttons
        }
}
</script>

 Thank you

Tags
Grid
Asked by
Max
Top achievements
Rank 1
Share this question
or