0

I have the following in my webgrid:

grid.Column(header: "Action", 
        format: delegate(dynamic i)
                {
                    return Ajax.ActionLink("Remove", "SomeAction", new {dataId = @i.id},
                                new AjaxOptions
                                    {
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "ropeDiv"
                                    });
                }
        )

and I want the contents of the column wrapped in a DIV... however I havent been able to get this to happen. I can do simple a simplet format where I am not needing a delegate... and I have seen a lot of simple formats. However nothing I have seen leads me to an answer on this.

I tried this:

grid.Column(header: "Action", 
        format: @<DIV> delegate(dynamic i)
                {
                    return Ajax.ActionLink("Remove", "SomeAction", new {dataId = @i.id},
                                new AjaxOptions
                                    {
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "ropeDiv"
                                    });
                }
                </DIV>
        )

this didnt work ...

Any thoughts?

tereško
  • 58,060
  • 25
  • 98
  • 150
Kixoka
  • 989
  • 4
  • 15
  • 37

1 Answers1

1

According to this article you could try this:

grid.Column(header: "Action",
  format: @<div>@Ajax.ActionLink("Remove", "SomeAction", new{dataId=item.Id},
    new AjaxOptions
    {
      InsertionMode = InsertionMode.Replace,
      UpdateTargetId = "ropeDiv"
    })</div>
)
Patko
  • 4,365
  • 1
  • 32
  • 27