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

[Solved] Ajax grid - Hide Command Buttons for rows with certain value

2 Answers 52 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.
Eugene O Sullivan
Top achievements
Rank 1
Eugene O Sullivan asked on 08 Jul 2011, 12:03 PM
Hi

Was wondering what the best solution is to hide the command buttons for certain rows (dependent on the field value in the dataitem), I've seen the CellAction solution that works for grids with server binding however it doesn't appear to work for AJAX binding. 

Cheers

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 11 Jul 2011, 08:33 AM
Hello Eugene O Sullivan,

 You may use rowDataBound client event, for example:

<script type="text/javascript">
    function rowDataBound(e) {
        if (e.dataItem.ID % 2 == 0) {
            $(e.row).find(".t-grid-edit, .t-grid-delete").hide();
        }   
    }
</script>

All the best,
Rosen
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Eugene O Sullivan
Top achievements
Rank 1
answered on 11 Jul 2011, 02:05 PM
Works a treat, thank you
Tags
Grid
Asked by
Eugene O Sullivan
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Eugene O Sullivan
Top achievements
Rank 1
Share this question
or