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
2715
Rowtemplate
posted

I cant get this to Work :

@(Html.Infragistics().Grid<intranet.mvc5.Models.m_Fravær>

().ID("grdFravaer")

.PrimaryKey("ID").ShowHeader(true)

.Columns(column =>

{

column.For(x => x.ID).Width("45px").HeaderText("RET");

column.For(x => x.ID2).Width("45px").HeaderText("SLET");

column.For(x => x.Fra_Dato).Width("90px").HeaderText("FRA").Format("dd-MM-yyyy");

column.For(x => x.Til_Dato).Width("90px").HeaderText("TIL").Format("dd-MM-yyyy");

column.For(x => x.Navn).Width("180px").HeaderText("NAVN");

column.For(x => x.Besked).Width("auto").HeaderText("BESKED");

column.For(x => x.Modtaget).Width("115px").HeaderText("MODTAGET").Format("dd-MM-yyyy HH:mm");

column.For(x => x.Ejer).Width("85px").HeaderText("AF");

column.For(x => x.DenneUge).Hidden(true);

})

.AutoGenerateColumns(false)

.AutoAdjustHeight(true)

.Width("100%")

.RowTemplate("<tr class={{if ${DenneUge} == 'J' }} 'DenneUgeFarve' {{else}} 'AndreUgerFarve'{{/if}}><td>{{if parseInt(${ID}) > -1}}<a href='/Fravaer/Ret/${ID}'><img src='/Content/images/Modify.png' width='14' /></a>{{/if}}</td><td>{{if parseInt(${ID}) > -1}}<a href='/Fravaer/Slet/${ID2}'><img src='/Content/images/erase.png' width='14' /></a>{{/if}}</td><td>${Fra_Dato}</td><td>${Til_Dato}</td><td>${Navn}</td><td>${Besked}</td><td>${Modtaget}</td><td>${Ejer}</td><td>${DenneUge}</td></tr>")

.DataSourceUrl(Url.Action("Hent_Fravær"))

.DataBind()

.Render()

)

I get this error

Unhandled exception at line 240, column 6483 in http://localhost:54144/Scripts/IG/infragistics.core.js

0x800a138f - Der opstod en JavaScript-kørselsfejl: Egenskaben 'start' kan ikke hentes for reference, der er udefineret eller null

Parents
  • 2745
    Offline posted

    Instead of using a method to convert the value into an integer, can you set the datatype of ID to "number"?

    column.For(x => x.ID).Width("45px").DataType("number").HeaderText("RET");

    Let the framework do the conversion for you.

Reply Children