Programatically setting SelectedIndex on ListView doesn't appear to select anything?

0
0

We are getting a strange result when trying to select the zero index item in code using SelectedIndex.

The highlight doesn’t move to the zero index and also selected items is empty.

Once the user clicks on any other index item or any other index item is set in code everything is from them on OK.

I’ve attached a simple example.

Regards,
Mark

  • You must to post comments
0
0

Hi Frank,

Thanks for the update.  The fix seems to have worked apart from in one use case where the following style code is run:

listView1.Items.Clear();
for (int i = 0; i < 3; ++i)
{
listView1.Items.Add(i.ToString());
}
listView1.SelectedIndex = 0;

To work around it we have done:

listView1.Items.Clear();
for (int i = 0; i < 3; ++i)
{
listView1.Items.Add(i.ToString());
}
// XXX: WORK AROUND?
listView1.FocusedItem = null;
listView1.SelectedIndex = 0;

Which seems to allow it to work fine.

I’ve attached an updated example.

Regards,
Mark

  • You must to post comments
0
0

Hi Mark,

issue #2020 is fixed in the latest Wisej release (2.0.54).

Best regards
Frank

  • You must to post comments
0
0

Thanks Mark,

it´s logged as issue #2020 and a fix will be included in the next Wisej build.

Best regards
Frank

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.