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
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.
This is not the problem
this line give me the error
class={{if ${DenneUge} == 'J' }} 'DenneUgeFarve' {{else}} 'AndreUgerFarve'{{/if}}