Reputation: 85
I have to display data using the telerik grid (master / detail) .
Is there a possibility to show the expand icon only if data exists for the master record? And how can i get this done?
Thanks in advance
Upvotes: 2
Views: 1884
Reputation: 56
On client-side:
<script>
function hidePlusSign(e) {
var row = e.row;
var dataItem = e.dataItem;
if (!dataItem.Expression) {
$('a.t-icon', e.row.cells).css('display', 'none');
}
}
</script>
...
.DetailView(d => d.ClientTemplate("<# if (expression) { #>" +
Html.Telerik().Grid<Details>...ToHtmlString()
+ "<# } #>")
.ClientEvents(e => e.OnRowDataBound("hidePlusSign"))
...
On server-side:
I think you get the idea. The template is easier and for hiding the plus sign use the RowAction.
Upvotes: 4