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

Hide Delete Command By Row

2 Answers 48 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.
Paul Smrz
Top achievements
Rank 1
Paul Smrz asked on 20 Oct 2010, 06:06 PM
Hi,

I'm using the grid in AJAX binding mode, and would like to hide the delete command on a row by row basis based on a column value.

So basically, each row has a column named HasChildData.  If it's true, I don't want them to be able to delete that row.  Anyone know how I can do that?

Thanks

Paul

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 Oct 2010, 06:58 AM
Hi Paul Smrz,

 You could use the OnRowDataBound event and hide the delete command through JavaScript:

function onRowDataBound(e) {
    if (e.dataItem.HasChildData)  {
          $(e.row).find('.t-grid-delete').remove();
    }
}

Greetings,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul Smrz
Top achievements
Rank 1
answered on 21 Oct 2010, 03:18 PM
Thanks, that worked great!
Tags
Grid
Asked by
Paul Smrz
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Paul Smrz
Top achievements
Rank 1
Share this question
or