Create serial number column in telerik mvc grid

Posted by Jayaraj on Stack Overflow See other posts from Stack Overflow or by Jayaraj
Published on 2010-06-02T05:13:40Z Indexed on 2010/06/02 8:43 UTC
Read the original article Hit count: 327

Filed under:

I could create a grid with telerik mvc

<% Html.Telerik().Grid(Model)
    .Name("ProductGrid")
    .Columns(columns => { 
                        columns.Bound(h => h.ProductName).Width("34%");
                        columns.Bound(h => h.Description).Width("60%");
                        columns.Bound(h => h.ProductID).Format(Html.ImageLink("Edit", "Products", new { Id = "{0}" }, "/Content/images/icon_edit.gif", "", new { Id = "edit{0}" }, null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%");
                        columns.Bound(h => h.ProductID).Format(Html.ImageLink("Delete", "Products", new { Id = "{0}" }, "/Content/images/icon_delete.gif", "", new { onclick = string.Format("return confirm('Are you sure to delete this add on?');") },null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%");
        })

    .EnableCustomBinding(true)
    .DataBinding(databinding => databinding.Ajax().Select("_Index", "ProductGrid"))
    .Pageable(settings => settings.Total((int)ViewData["TotalPages"])
    .PageSize(10))
    .Sortable()
    .Render(); %>

but I need to add a serial number column in telerik grid.How can i do this?

© Stack Overflow or respective owner

Related posts about asp.net-mvc