C#

[C#]ListView row index 구하기 예제

선영아 사랑해 2016. 2. 3. 14:52

ListView를 사용하다보면 사용자가 선택 한 Row의 인덱스를 구해야 하는 경우가 많습니다.


그럴때 유용하게 사용 할 수 있는 예제이오니 개발에 참고해보세요....



using System.Collections;



IEnumerator enm = listView1.SelectedIndices.GetEnumerator();


while (enm.MoveNext())
{
    int select_index = (int)enm.Current;//선택 한 Row Index
}