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

[Solved] strange hidden input generated from Delete Command

0 Answers 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fran
Top achievements
Rank 1
Fran asked on 14 Jan 2011, 12:59 AM
I have a grid

    <%= Html.Telerik().Grid(Model.GroupSets)
            .Name("GroupSets")
                .DataKeys(keys => { keys.Add(p => p.Id); })  
                .DataBinding(db => db.Server()
                            .Select("Details""RuleGroupSet")
                            .Delete("Delete""RuleGroupSet"))
                .Columns(columns =>
                {
                    columns.Command(commands => 
                    { 
                        commands.Select().ButtonType(GridButtonType.Text);
                        if (Roles.IsUserInRole(User.Identity.Name, "Administrator"))
                        {
                            commands.Delete().ButtonType(GridButtonType.Text);
                        }
                    });
                    columns.Bound(o => o.RuleSetName);
                    columns.Bound(o => o.Score);
                    columns.Bound(o => o.RequiresManualReview);
                })
                .Filterable()
                        .ToolBar(toolbar => toolbar.Custom().Text("Add Rule Set").Action("AddRuleGroupSet""RuleGroup"))
                .Sortable()
    %>
the delete form that is getting generated looks like this
<form class="t-grid-actions" method="post" action="/RuleGroupSet/Delete/92b3177f-0989-40fe-b4b3-e478cb1f154d">
<div>
<input type="hidden" value="00000000-0000-0000-0000-000000000000" name="Id">
<button class="t-grid-action t-button t-state-default t-grid-delete" type="submit">Delete</button>
</div>
</form>

The opening form tag is correct and has the correct Id that I want to delete in he post action.  the hidden input in the form has the id of the parent object.  This either shouldn't be there or should be the correct Id (the one from the post action). 

My controller is getting passed the "00000000-0000-0000-0000-000000000000" instead of the "92b3177f-0989-40fe-b4b3-e478cb1f154d"
Tags
Grid
Asked by
Fran
Top achievements
Rank 1
Share this question
or