This project is read-only.

Expose current RowIndex

Mar 2, 2015 at 1:42 PM
There is a situation where I need to add html controls into the grid and I need to create the name attribute dinamically using the row index.

Is the RowIndex already exposed and if not, what's the best way to expose it?

Thanks!
Mar 11, 2015 at 1:31 PM
Edited Mar 11, 2015 at 1:32 PM
How is this?
@{
    int rowIndex = 0;
}

@Html.Grid(Model).Columns(columns =>
{
    columns.Add().RenderValueAs(row => (rowIndex++).ToString());
})