Hi all,
I am populating my list view with some dummy text with checkboxes on.
My questions are:
1-I am trying get the text and index for the items that have been Checked.
int totalItems=listView1.Items.Count-1;
for (int n=0;n<totalItems;n++)
{
if (listView1.CheckedItems[n].Checked==true)
{
MessageBox.Show("Selected Item Text: " + listView1.Items[n].Text);
MessageBox.Show("Selected Item Index: " + listView1.Items[n].Index);
}
}
I do as above. But It dispalys even un checked rows. I dont' know why???
2- How can i get only one checked row? If multiple selection is false?
regards
I am populating my list view with some dummy text with checkboxes on.
My questions are:
1-I am trying get the text and index for the items that have been Checked.
int totalItems=listView1.Items.Count-1;
for (int n=0;n<totalItems;n++)
{
if (listView1.CheckedItems[n].Checked==true)
{
MessageBox.Show("Selected Item Text: " + listView1.Items[n].Text);
MessageBox.Show("Selected Item Index: " + listView1.Items[n].Index);
}
}
I do as above. But It dispalys even un checked rows. I dont' know why???
2- How can i get only one checked row? If multiple selection is false?
regards