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

Creating a Custom command button and passing parameters

1 Answer 405 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AspenSquare
Top achievements
Rank 1
AspenSquare asked on 13 Nov 2012, 06:52 PM
I'm trying to create a custom command button to fire a custom delete function. I need to pass the ID of my model to my custom delete function. You'll notice that I'm trying to pass in a static '5' as a test but that isn't working either.

Any help would be greatly appreciated.

@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Name).Width(240);
        columns.Bound(p => p.City).Width(170);
        columns.Bound(p => p.State).Width(170);
        columns.Command(command =>
        {
            command.Edit();
            command.Custom("Delete").Click("PropertyPage.DeleteProperty").HtmlAttributes(new { @Id = 5 });
            }).Width(166);
        })
        .Scrollable()
        .Editable(editable => editable.Mode(GridEditMode.InLine))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(p => p.Id))
            .Read(read => read.Action("PropertyRead", "Property"))
            .Update(update => update.Action("Update", "Property"))
            .Destroy(update => update.Action("Delete", "Property"))
    ))

1 Answer, 1 is accepted

Sort by
0
AspenSquare
Top achievements
Rank 1
answered on 14 Nov 2012, 05:04 AM
I believe I posted this in the wrong place.

Could someone move this to the appropriate forum please?

Kendo ASP.NET MVC
Tags
Grid
Asked by
AspenSquare
Top achievements
Rank 1
Answers by
AspenSquare
Top achievements
Rank 1
Share this question
or