This is a migrated thread and some comments may be shown as answers.

[Solved] Display Row Index Server Side ?

1 Answer 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dominic
Top achievements
Rank 1
Dominic asked on 23 Apr 2012, 07:25 PM
Hi,

I am trying to display the row index on the grid. Is there an easy way to do this because i cant find anything about it in the grid documentation ? I'm using server-side binding.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Pechka
Top achievements
Rank 1
answered on 24 Apr 2012, 07:13 AM
Yo mate,

You should use templated column.

e.g.
@model IEnumerable<SomeModel>
@{int counter = 0;}
@(Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Template(@<text>@(counter++)</text>);
        })
)
Tags
Grid
Asked by
Dominic
Top achievements
Rank 1
Answers by
Pechka
Top achievements
Rank 1
Share this question
or