This question is locked. New answers and comments are not allowed.
Hi there.
First of all, i would like to congratulate telerik team for the great work put into MVC controls.
But, we have the following question regarding grid and hidden fields on it:
1) On update scenario, we must add hidden values to be passed to controller's action. We must have it for validation proposes.
We're trying to use the BoundColumn.Hidden() method to hide what we want and pass it to controller's on POST. The problem is that none of the values are getting into the controller's action. (we double checked it using fiddler proxy).
2) On Insert scenario, we want to initialize this hidden values as well for the same motive, i.e., validation.
We're using server binding, and the code is this:
Basically we want to keep the value of the property
This is the right approach for doing it?
Thanks in advance for your help.
With kindest regards.
Tiago
First of all, i would like to congratulate telerik team for the great work put into MVC controls.
But, we have the following question regarding grid and hidden fields on it:
1) On update scenario, we must add hidden values to be passed to controller's action. We must have it for validation proposes.
We're trying to use the BoundColumn.Hidden() method to hide what we want and pass it to controller's on POST. The problem is that none of the values are getting into the controller's action. (we double checked it using fiddler proxy).
2) On Insert scenario, we want to initialize this hidden values as well for the same motive, i.e., validation.
We're using server binding, and the code is this:
<%Html.Telerik().Grid(Model.Details).Name("Grid").DataKeys(keys => keys.Add(c => c.Id)).ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text)).DataBinding(dataBinding => dataBinding.Server().Insert("CreateDetail", "ExchangeRates", new { mode = GridEditMode.InLine, type = GridButtonType.Text }).Update("EditDetail", "ExchangeRates", new { mode = GridEditMode.InLine, type = GridButtonType.Text })).Columns(columns =>{columns.Bound(p => p.Value).Width(120).Title(Resources.Value);columns.Bound(p => p.StartDate).Width(120);columns.Bound(p => p.EndDate).Width(120);columns.Bound(p => p.ExchangeRateLastStartDate).Hidden();columns.Command(commands =>{commands.Edit().ButtonType(GridButtonType.Text);}).Title(Resources.Action);}).Pageable(paging => paging.PageSize(8)).Render();%>Basically we want to keep the value of the property
ExchangeRateLastStartDate stored between post backs, and initialize it when adding a new record.This is the right approach for doing it?
Thanks in advance for your help.
With kindest regards.
Tiago