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

Grid -> Column -> Form Post

1 Answer 209 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 01 Mar 2016, 01:35 AM

I am attempting to post to an action in the controller from a custom button in the Grid component. At first the Grid would render the form outside of the column, this was fixed by {}.Render() which appears to generate the form in the correct location.

My problem is that the items being passed to the form are always null, regardles:

I'll simply my example:

@{Html.Kendo().Grid(Model)
              .Name("IterationGrid")
              .Sortable()
               .Columns(columns =>
                            {
 
                               columns.Tempate(@<text>
 
            using (Html.BeginForm("RemindEmployee", "Evaluations", FormMethod.Post))
            {
                Html.Hidden("employeeID", item.Employee.EmployeeID);
                Html.Hidden("reviewID", item.ReviewId);
                Html.Hidden("fullname", item.Employee.Fullname);
                <input type="submit" name="Remind" value="Remind" class="btn btn-primary btn-k-grid" />
              }@</text>).Title("Action"); }).Render(); }

As I mentioned this appears to work fine, and the Controller has:

[HttpPost]
public ActionResult RemindEmployee(int? employeeID, int? reviewID, string fullname) { }

Though the parameters are always passed as null. What's the best way to handle this example here?

Note: I've already used some javascript $.post() to do the same thing, but I would like to know the proper way to get the above to work with hidden forms for my own benefit.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 07 Mar 2016, 08:26 AM
Hello Kevin,

Please check out this thread where the problem is discussed.

Regards,
Vasil
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or