It is actually firing three times, the selecteditems counts are 1,0,1
> Hi,
>
> I have a Listview that is firing an event twice and both time the
> selecteditems count is = 1
>
> In the call stack there is form.show
Claes Bergefall - 23 Feb 2006 14:28 GMT
You need to provide some more information
What exactly are you doing to see this behaviour?
/claes
> It is actually firing three times, the selecteditems counts are 1,0,1
>
[quoted text clipped - 4 lines]
>>
>> In the call stack there is form.show
Jared - 28 Feb 2006 02:40 GMT
Only thing I can think of Is loading the Listview grid while form is not
visible.
I now have genric routine called from a Click event. I successfully have
used SLI event on many other form with the normal double firing.
I think, this behavior is by design. That is, when you click an item in
listview, if thre is a previously selected one, that one gets deselected
first, then the clicked one gets selected. This behavior puzzled me when I
used listview first time in .NET. In old VB5/6, there is an event ItemClick,
which is not available in .NET listview anymore.
So, when I want to get a selected item in listview's SelectedIncdexChanged
event handler, I do this:
private void MyListView_SelectedIndexChanged(object sender.....)
{
if (MyListView.SelectedItems.Count==0) return;
//Then do whatever here.
}
> Hi,
>
> I have a Listview that is firing an event twice and both time the
> selecteditems count is = 1
>
> In the call stack there is form.show