How to get 'RowIndex' of an 'ObjectListView'

BenTam-3003 681 Reputation points

Dear All,

How to get the last row number of an 'ObjectListView'? I search in Google and find the page In (52), I find the code as follows.

this.olv.ButtonClick += delegate(object sender, CellClickEventArgs e) {
    Debug.WriteLine(String.Format("Button clicked: ({0}, {1}, {2})", e.RowIndex, e.SubItem, e.Model));

I also know there is a 'RowsPerPage' property.

Which one should I use, 'RowsPerpage' or 'delegate'? I have no knowledge of 'delegate'. If 'delegate' is the final answer, where to put it?

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,493 questions
No comments
{count} votes

Accepted answer
  1. Castorix31 68,311 Reputation points

    How to get the last row number of an 'ObjectListView'?

    The last is just the number of items - 1 :

    int nLastIndex = objectListView1.Items.Count - 1;

0 additional answers

Sort by: Most helpful