Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
problem get Data igGrid
posted

Hi,

I have one in a partial igGrid. I call from Razor.
The model is not a simple IQueriable (of Object).
I created a model in which a property is the list that is displayed in the igGrid.
I want to recover data from igGrid, and I have the iggGrid within a form of Razor.
But the method never get data controller.

This is my model:

Public Class MyModel
Property listGridAs New List(Of Object)
Property listAcordeon As New Dictionary(Of String, List(Of String))
End Class

This is my view:

<h2>Acordeon</h2>



@Using (Html.BeginForm("create-excel-worksheet2", "Prueba", FormMethod.Post))
@<div >
<div >
<input name="model" id="contenidoModelo" type="hidden" />
<button id="btnSubmit" type="submit" value="EXPORT"></button>
</div>
</div>
@<div id="ContenidoTabla">
@Html.Partial("GridExcelExporter",Model.listGrid.AsQueryable)
</div>
End Using

The view partial which I have the igGrid:

@Imports Infragistics.Web.Mvc
@ModelType IQueryable(Of Object)
@Code
Layout = ""
End Code


@(Html.Infragistics().Grid(Model).ID("grid1").PrimaryKey("ID") _
.AutoGenerateColumns(True) _
.UpdateUrl(Url.Action("EditingSaveChanges")) _
.Features(Sub(features2)
features2.Paging()
features2.Selection.Mode(SelectionMode.Row).MultipleSelection(False)
features2.Updating() _
.EnableAddRow(True).AddRowLabel("Añadir nueva fila") _
.EnableDeleteRow(False) _
.EditMode(GridEditMode.Row) _
.ColumnSettings(Sub(setting)
setting.ColumnSetting().ColumnKey("ID").ReadOnly(True)
End Sub)
End Sub).Width("705").Height("500") _
.DataSourceUrl(Url.Action("PagingGetData")).DataBind().Render())

And the handler method:

<HttpPost> _
<ActionName("create-excel-worksheet2")> _
Public Sub ExcelExporter2(model As object)

Dim content as list(of object) = model

End sub

I debug my project, when I see the data coming to the controller, this is nothing.

Thanks Advances.

Best Regards.

  • 29417
    Offline posted

    Hello nitaGM, 

    I'm just following up to see whether you still need any assistance with this.

    If so don't hesitate to let me know.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://es.infragistics.com/support

     

  • 29417
    Offline posted

     Hello nitaGM ,

     

    Thank you for posting in our forum.

     

    Are you trying to get the value of the hidden field in that action?

     

    <input name="model" id="contenidoModelo" type="hidden" />

     

    Since it has a name of “model” the post action will pass its value as a parameter to the action “create-excel-worksheet2”.

    If that’s the value you’re trying to get where are you population it?

     

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://es.infragistics.com/support