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

How to use razor condition syntax in grid-field templete

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krunal
Top achievements
Rank 1
Krunal asked on 05 Jun 2014, 09:37 AM
Hi

i want to display a link in Grid field. now i have a IsReady Bool field in Model, on Grid read action model fetch with values.

now if this field is true then i want to show this link or if false then i want to hide it.
i want to use razor condition like this is @(IsReady) ? Style:" "  : Style: "display:none" but i can't use because there is "" ' ' error in kendo grid so can any one guide me .

my code is "<a href='' #= @("#=IsReady#").ToString().ToLower() ? 'style=\"display:none;\"' : '' #>link</a>"

Regards,
vinit

1 Answer, 1 is accepted

Sort by
0
Krunal
Top achievements
Rank 1
answered on 05 Jun 2014, 09:46 AM
Hi

i found solution i have to use this and it's works

"<a href='' #=IsReady ? '' : 'style=\"display:none;\"' #>link</a>"

Regards,
vinit
Tags
Grid
Asked by
Krunal
Top achievements
Rank 1
Answers by
Krunal
Top achievements
Rank 1
Share this question
or