I just upgraded a asp.net mvc 5 project to 14.1 to find out that iggrid does not support RowTemplate
Why?
Hello Christian,
Internally the row template was implemented as a gateway for the column templates. Thus we had to parse the row template string and split it by columns. This approach proved to be slow and error prone, that's why we decided to get rid of it. As a result we gained around 30% faster rendering (columns which don't need templating do not need to go through the templating code anymore, which was the case when using row templates).
Hope this helps,
Martin Pavlov Infragistics, Inc.
Can You help me convert this to use column template
@(Html.Infragistics().Grid<intranet.mvc5.Models.Visitor_Liste>().ID("grdDVisitor")
.PrimaryKey("ID").ShowHeader(false)
.Columns(column =>
{
column.For(x => x.ID).Width("55px").Hidden(ViewBag.KanSe == "OK" ? false : true);
column.For(x => x.ID2).Width("55px").Hidden(ViewBag.KanSe == "OK" ? false : true);
column.For(x => x.Visitor).Width("auto");
})
.Features(feature =>
feature.Paging().PageSize(6)
.ShowPagerRecordsLabel(false)
.ShowPageSizeDropDown(false)
.NextPageLabelText("")
.PrevPageLabelText("");
.AutoGenerateColumns(false)
.AutoAdjustHeight(true)
.Width("710px")
.RowTemplate("<tr><td>{{if parseInt(${ID}) > -1}}<a href='/Visitor/Ret/${ID}'><img src='/Content/images/Modify.png' /></a>{{/if}}</td><td>{{if parseInt(${ID}) > -1}}<a href='/Visitor/Slet/${ID2}'><img src='/Content/images/erase.png' /></a>{{/if}}</td><td>{{html Visitor}}</td></tr>")
.DataSourceUrl(Url.Action("Hent_Gaester"))
.DataBind()
.Render()
)
How do I change background color for a row
I need to change some rows to a different color
Try using the following approach: Setting attributes to table rows with a row template not possible.
Hope this helps,Martin PavlovInfragistics, Inc.
the link does not work
Sorry, my fault. Try now: Setting attributes to table rows with a row template not possible.
The idea is to use the igGrid.rendered or igGrid.rowsRendered events to execute some JavaScript to apply the styles to the respective table rows.
Best regards,
Martin PavlovInfragistics, Inc.