0
votes

I am using kendo grid in asp.net mvc4. A column of a grid is Email, so I make a link to the column like that:

col.Bound(con => con.EmailName).Title("Email").Width(120).ClientTemplate("<a href=\"mailto:#=EmailName#\"> #=EmailName == null ? '': EmailName#</a>").Filterable(true);

It's Working well. But, I also have to field DoNotEmail and DoNotEmailMarketingCampaigns Whose are Boolean. I want to make the link if both field are false, otherwise I will not make a link. I tried following way:

col.Bound(con => con.EmailName).Title("Email").Width(120).ClientTemplate("#if(!DoNotEmailMarketingCampaigns && !DoNotEmail) { # <a href=\"mailto:#=EmailName#\"> #=EmailName == null ? '': EmailName#</a> #} else { #=EmailName == null ? '': EmailName# } #").Filterable(true);   

but it's not serving my purpose. Any suggestions?

1

1 Answers

3
votes

Finally Done with following Code:

col.Bound(con => con.EmailName).Title("Email").Width(120).ClientTemplate("#if(!DoNotEmailMarketingCampaigns && !DoNotEmail) { # <a href=\"mailto:#=EmailName#\"> #=EmailName == null ? '': EmailName#</a> #} else {# #=EmailName == null ? '': EmailName# #} #").Filterable(true);