المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Problem with Listview,help!



C# Programming
06-05-2010, 09:11 PM
The structure of my listview is:

Select ID Name Age
--------------------------------------------------
Item[0]: checkbox 25 Richard 24 Item[1]: checkbox 26 Tom 20 Item[2]: checkbox 27 Alice 22 ......many.....

Now, I want to get the name or age of current item when I make the item checked or unchecked. In other words, when I click a checkbox, I need to know the index of the item. If there is only one checked item, we can use "foreach" to get the index, but there are some already checked items.For example:

Item[0] and Item[1] are checked.
I click the checkbox of Item[2], How can I know what I clicked is Item[2]? (Here is not related to SelectedItem.)

Excuse me,My English is poor. http://www.barakasoft.com/script/Forums/Images/smiley_wink.gif