Hi All,
I'm using a listview control, in which items can be traversed up and down by
using the action button.
However, I'm not able to trap this traversal or event by the action button.
Though I'm able to use the listView.SelectedIndexChanged event, but in this
event, I'm not able to get the selected Item property..
if I use listView.SelectedIndices[0] property, it gives me a System Out of
Range exception.. MSDN advises SelectedItems property to use, but it isn't
supported by .NET CF. Is there a way where I can get to move through the
items up and down and then perform any action related to it..
This is my code snippet which gives me the error
private void lvSearch_SelectedIndexChanged(object sender, EventArgs e)
{
if((lvSearch.Items.Count > 0)&&(lvSearch.Items[0].Text!=NOTFOUNDMSG))
{
int ClickedId=lvSearch.SelectedIndices[0];
ItemId=Convert.ToInt32(lvSearch.Items[ClickedId].SubItems[1].Text);
int AudiId=Convert.ToInt32(lvSearch.Items[ClickedId].SubItems[2].Text);
DisplayPhrase(ItemId,AudiId);
}
}
Any help would be deeply appreciated..
Regards,
Asheesh
|