Ian Vink
Ian Vink

Reputation: 68750

Kendo: Grid Column Link with 2 field values

Using Kendo UI with MVC 4:

I have a Grid with columns. I need to create a link from 2 fields in the model the grid is bound to. "Country" and "State"

          columns.Bound(p => p.Country)
              .ClientTemplate(
                  "<a href='" + Url.Action("Detach", "Edit")">Detach</a>"
               );

How do I add /Country/State to the URL? These values come from the grid's bound model.

Upvotes: 1

Views: 4659

Answers (1)

OnaBai
OnaBai

Reputation: 40887

You might use a template referencing the fields:

columns.Bound(p => p.Country)
          .ClientTemplate(
              "<a href='" + Url.Action("Detach", "Edit") + "/#= Country #/#= State #'">Detach</a>"
           );

Check this How do I use action links?

Upvotes: 1

Related Questions