bug with listview in C# - 2 clicks required to select item

  • Thread starter Thread starter Bruce Bakely
  • Start date Start date
B

Bruce Bakely

I have a simple listview using view=Details. When the user clicks on an item
I pop up a message. After the user hits OK on the popup message, the
original form is now dead to user input until a click is made anywhere on
the form. In other words, in order to select another item in the list, you
have to tap somewhere on the form, and then tap on the item.
Any ideas? Has anyone else seen this behavior, or NOT seen this behavior on
different hardware?
I have a symbol PDT8100 using pocket pc 2002, C#.
It works fine on the emulator.

my code:
private void Form1_Load(object sender, System.EventArgs e)

{

listView1.Columns.Add("Item", 50, HorizontalAlignment.Center);

listView1.Items.Add(new ListViewItem("item1"));

listView1.Items.Add(new ListViewItem("item2"));

}

private void listView1_SelectedIndexChanged(object sender, System.EventArgs
e)

{

if (listView1.SelectedIndices.Count == 1)

MessageBox.Show("listview");

//listView1.Focus(); // doesn't help

}
 
I've seen this as well

have you tried giving your form the focus after the popup dialog box has
gone rather than the list view

shaun
 
Shaun Wilde said:
I've seen this as well

have you tried giving your form the focus after the popup dialog box has
gone rather than the list view

Or maybe both the ListView and the form?

/Keld Laursen
 
Yep. I've tried combinations of giving the ListView, ListViewItems, and/or
form the focus, as well as manually turning off the ListViewItem selected
property. My guess is that ListView is just broken in the compact framework,
no workaround.
 
Yep. I've tried playing with .Focus and .Selected, in various combinations.
As far as I can tell this is a bug in the compact framework with no
workaround.
 
Back
Top