1
I’m using MVC in my application and in Views I am using several tools from Telerik.
I need to get some information from a POST that I give in mine View.
Segue View:
<div class="div-grid">
@using (Html.BeginForm("ExecutaExportacao", "ExportacaoFinal"))
{
    @(Html.Telerik().Grid(listRateioFinal)
          .Name("Grid")
          .Columns(columns =>
          {
              columns.Template(
                  @<text>
                       <input name="checkedCli" type="checkbox" value="@item.Row.ItemArray[1].ToString()" title="checkedCli" />
                  </text>).Title("").Width(10).HtmlAttributes(new { style = "text-align:center" });
              columns.Bound(o => o.Row.ItemArray[0]).Width(100).Title("ANO MES");
              columns.Bound(o => o.Row.ItemArray[1]).Width(100).Title("ID_CLI");
              columns.Bound(o => o.Row.ItemArray[2]).Width(100).Title("VALOR");
          })
          .Scrollable())
    <input type="submit" value="Exportar Arquivo"/>
}
</div>
Segue Controller:
[HttpPost]
public ActionResult ExecutaExportacao(int[] checkedCli)
{
    ExportarArquivo(anoMes);
    return RedirectToAction("Index");
}
With this code I get the values of the array checkedCli, but would also like to get the column values MONTH YEAR Grid. I particularly can’t explain why it works to obtain data from checkedCli, I suppose it’s the attribute name which refers to the POST, indicating that it is the value of the parameter checkedCli controller’s.
How do I also get the column values MONTH YEAR ?
That instruction:
columns.Bound(o => o.Row.ItemArray[0]).Width(100).Title("ANO MES");generates a form field?– Leonel Sanches da Silva
You could add to the question which HTML is generated by the component you are using?
– Andre Calil