1

I am use a WebGird in my MVC Demo application and I'm trying to use ActionLink in WebGrid how can I use it?

View:-

@model IEnumerable<RotationManager.Models.tableCustomer_M>
@{
    WebGrid listGrid = new WebGrid(Model);
}

 @listGrid.GetHtml(tableStyle: "table", footerStyle: "foot",
    columns: new[]{
     listGrid.Column("Customer_Id",format: (item) => Html.ActionLink(item.Customer_Id, "Edit",new {@id=item.Customer_Id},null))
    })

Above line of code isn't work.

Please help me!

Any help will be appreciated!

Jay Shukla
  • 782
  • 1
  • 13
  • 24

1 Answers1

3
@listGrid.GetHtml(tableStyle: "table", footerStyle: "foot",
    columns: new[]{
     listGrid.Column(header: "Customer_Id", format: item => new HtmlString(
                     Html.ActionLink((string)item.Customer_Id.ToString(), 
                    "Edit", new { @id = item.Customer_Id} ).ToString()))
    })
Splendor
  • 1,386
  • 6
  • 28
  • 62