This project is read-only.

How to render two button into one column

Oct 30, 2013 at 5:38 AM
How to render two button into one column.
Oct 30, 2013 at 5:46 AM
Oct 30, 2013 at 5:57 AM
Edited Oct 30, 2013 at 5:58 AM
HI,
I want to render two button into one column. could you provide me any code.
Oct 30, 2013 at 5:59 AM
@helper CustomRenderingOfColumn(Order order)
{
    <button type="submit">Button 1</button>
    <button type="submit">Button 2</button>
}

@Html.Grid(Model)..Columns(columns =>
{
        columns.Add()
                .Titled("Title")
                .RenderValueAs(o => CustomRenderingOfColumn(o));
})
Marked as answer by haven2hell on 10/29/2013 at 10:02 PM
Feb 11, 2014 at 8:19 AM
Hi

I'm trying to render a button within the grid using the above solution but it doesn't seem to be working, it just renders the actual text: <form method etc.

This is my View:

@helper Edit(int personId)
{
<form method="get" action="@Url.Action("Edit", "UserAdministration", new { id = personId })">
    <input type="submit" value="Edit" />
</form>
}

@Html.Grid(Model).Named("personGrid").Columns(columns =>
{
columns.Add().RenderValueAs(person => Edit(person.PersonId));
})

Am I doing something wrong here?
Feb 11, 2014 at 8:40 AM
Nevermind, I set Encoded and Sanitized to false and it worked.
Apr 15, 2016 at 5:06 PM
NullZoR,
could you please elaborate??

i did not understand how you did it....