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
765
IgGrid/Razor in MVC3
posted

Hi.

I can't use Infragistics in my solution, I agree the reference Infragistics.Web.Mvc.dll, but don't work, the version installed is 2011.2, and this is the code in my view:

@model Infragistics.Web.Mvc.SampleViewPage<IQueryable<CxcModels.Models.tblPaises>>

@

 

using Infragistics.Web.Mvc

<

 

 

h2>Catalogo de Pais</h2>

<

 

 

p>@Html.ActionLink("Crear Pais", "Create")</p>

@(Html.Infragistics().Grid(Model).ID(

 

"gridPaises").UpdateUr("tblPaises").PrimaryKey("idPais")

.AutoGenerateColumns(

 

true)

 

 

 

 

 

.Columns(column => {column.For(x => x.idPais).DataType("string").HeaderText("Pais");

column.For(x => x.Nombre).DataType(

 

"string").HeaderText("Nombre"); false).PageSize(10).PrevPageLabelText("Anterior").NextPageLabelText("Siguiente"); "idPais").AllowSorting(true);});

features.Selection().MouseDragSelect(

 

true).MultipleSelection(true).Mode(SelectionMode.Row);

 

 

})

.Features(features =>{

features.Paging().VisiblePageCount(5).ShowPageSizeDropDown(

 

 

features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings =>{

settings.ColumnSetting().ColumnKey(

 

 

 

features.Selection().MouseDragSelect(true).MultipleSelection(true).Mode(SelectionMode.Cell); .DataSourceUrl(Url.Action("tblPaises"))

.Width(

 

"100%")

.Height(

 

"350px")

features.Updating();

})

 

 

 

and there's my references:

I hope and can help me thanks in advance

Parents
  • 2225
    posted

    It looks like you are missing the following two lines:

    .Databind()
    .Render()

    .Render should be the last method called in your igGrid block. Here is an example:

    @( Html.Infragistics().Grid<Models.item>()
    .ID("igGrid1"
    )
    .FixedHeaders(true
    )
    .Columns(column =>
    {
    column.For(x => x.fld1).HeaderText(
    "fld1").Width("90"
    );
    column.For(x => x.fld2).HeaderText(
    "fld2").Format("MM/dd/yyyy").Width("100"
    );
    column.For(x => x.fld3).HeaderText(
    "fld3").Format("currency").Width("155"
    );
    column.For(x => x.fld4).HeaderText(
    "fld4").Width("155"
    );
    column.For(x => x.fld5).HeaderText(
    "fld5").Format("MM/dd/yyyy").Width("100"
    );
    })
    .ClientDataSourceType(ClientDataSourceType.JSON)
    .DataSourceUrl(Url.Action(
    "someFunction", new RouteValueDictionary(new
    { id = Model.id})))
    .Width(
    "100%"
    )
    .Height(
    "400"
    )
    .DataBind()
    .Render()
    )

     

Reply Children