DataGrid column with numbers of rows

  • Thread starter Thread starter Przemo
  • Start date Start date
P

Przemo

In my DataGrid, I would like to put into the first column
number representing the number of row on screen.
I am using DataGrid1_ItemCreated event to color some rows
depending on data and I thougt that it could be a good
place to insert number of row into the first column.

But how to calculate this number?
I want diffrent way than keeping variable 'Count' in
session or StateView and incrementing it every
ItemCreated event is lunched.
Is it possible to read this from DataGrid?

Thank you.
 
try this
<%# Int32.Parse(DataBinder.Eval(Container,"ItemIndex","")) + 1 %>
Av.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top