![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | ListBox vs. ListView Is there a way to get a ListView control to fire its SelectedIndexChanged event like the ListBox control? When the user selects multiple items at once, the ListView fires the event as each item gets selected. The ListBox waits to fire the event until all selections are complete. Thanks, Mike |
My System Specs![]() |
| | #2 (permalink) |
| | Re: ListBox vs. ListView "Mike" <MLM450@xxxxxx> wrote in message news:26ddc286-ef50-4ddf-a65e-f1fe2a828e4f@xxxxxx Quote: > Is there a way to get a ListView control to fire its > SelectedIndexChanged event like the ListBox control? When the user > selects multiple items at once, the ListView fires the event as each > item gets selected. The ListBox waits to fire the event until all > selections are complete. (I, for one, welcome our new telepathic list box overlords....) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: ListBox vs. ListView On Nov 18, 4:32*pm, "Jeff Johnson" <i....@xxxxxx> wrote: Quote: > "Mike" <MLM...@xxxxxx> wrote in message > > news:26ddc286-ef50-4ddf-a65e-f1fe2a828e4f@xxxxxx > Quote: > > Is there a way to get a ListView control to fire its > > SelectedIndexChanged event like the ListBox control? When the user > > selects multiple items at once, the ListView fires the event as each > > item gets selected. The ListBox waits to fire the event until all > > selections are complete. > It does? How do it KNOW that the selections are complete? > > (I, for one, welcome our new telepathic list box overlords....) shift-click the last item, I think the control needs to know it is selecting all 100 items or else how could it do it? |
My System Specs![]() |
| | #4 (permalink) |
| | Re: ListBox vs. ListView "Mike" <MLM450@xxxxxx> wrote in message news:c1b951c7-c1f7-4ea7-988e-8dde7ab588b7@xxxxxx Quote: Quote: Quote: >>> Is there a way to get a ListView control to fire its >>> SelectedIndexChanged event like the ListBox control? When the user >>> selects multiple items at once, the ListView fires the event as each >>> item gets selected. The ListBox waits to fire the event until all >>> selections are complete. Quote: >> It does? How do it KNOW that the selections are complete? Quote: >> (I, for one, welcome our new telepathic list box overlords....) Quote: > How could it not know? If I click on the first of 100 items and then > shift-click the last item, I think the control needs to know it is > selecting all 100 items or else how could it do it? There's also the type where you can Ctrl+click items, and do it as many times as you want. And you're saying that the first click (on the "anchor" item) doesn't fire SelectedIndexChanged? I'm having difficulty believing that. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: ListBox vs. ListView "Jeff Johnson" <i.get@xxxxxx> wrote in message news:uE0QsjcSJHA.5860@xxxxxx Quote: Quote: Quote: >>>> Is there a way to get a ListView control to fire its >>>> SelectedIndexChanged event like the ListBox control? When the user >>>> selects multiple items at once, the ListView fires the event as each >>>> item gets selected. The ListBox waits to fire the event until all >>>> selections are complete. Quote: >>> It does? How do it KNOW that the selections are complete? Quote: >>> (I, for one, welcome our new telepathic list box overlords....) Quote: >> How could it not know? If I click on the first of 100 items and then >> shift-click the last item, I think the control needs to know it is >> selecting all 100 items or else how could it do it? > Well, you didn't specify what type of multi-selection you were using. > There's also the type where you can Ctrl+click items, and do it as many > times as you want. > > And you're saying that the first click (on the "anchor" item) doesn't fire > SelectedIndexChanged? I'm having difficulty believing that. last. I think the behavior you're seeing is due to the fact that the list view is far more complicated than the list box. For example, the list items are not necessarily in the same order that you see them, and they're independent objects as well, so the list view has to notify them that they've been selected and they in turn probably raise an event which the list box passes on. (This is speculation, of course.) So here's the real question: would it be that hard to change your code to deal with it? Are you updating your UI dynamically based on the selections? |
My System Specs![]() |
| | #6 (permalink) |
| | Re: ListBox vs. ListView On Nov 18, 5:14*pm, "Jeff Johnson" <i....@xxxxxx> wrote: Quote: > "Jeff Johnson" <i....@xxxxxx> wrote in message > > news:uE0QsjcSJHA.5860@xxxxxx > > > > > Quote: Quote: > >>>> Is there a way to get a ListView control to fire its > >>>> SelectedIndexChanged event like the ListBox control? When the user > >>>> selects multiple items at once, the ListView fires the event as each > >>>> item gets selected. The ListBox waits to fire the event until all > >>>> selections are complete. Quote: Quote: > >>> It does? How do it KNOW that the selections are complete? Quote: Quote: > >>> (I, for one, welcome our new telepathic list box overlords....) Quote: Quote: > >> How could it not know? If I click on the first of 100 items and then > >> shift-click the last item, I think the control needs to know it is > >> selecting all 100 items or else how could it do it? Quote: > > Well, you didn't specify what type of multi-selection you were using. > > There's also the type where you can Ctrl+click items, and do it as many > > times as you want. Quote: > > And you're saying that the first click (on the "anchor" item) doesn't fire > > SelectedIndexChanged? I'm having difficulty believing that. > Oh, wait, you're saying you only want two event firings: the first and the > last. I think the behavior you're seeing is due to the fact that the list > view is far more complicated than the list box. For example, the list items > are not necessarily in the same order that you see them, and they're > independent objects as well, so the list view has to notify them that > they've been selected and they in turn probably raise an event which the > list box passes on. (This is speculation, of course.) > > So here's the real question: would it be that hard to change your code to > deal with it? Are you updating your UI dynamically based on the selections?- Hide quoted text - > > - Show quoted text - things to handle how it works, I was just hoping there was a simple property or something somewhere that would make it work like the list box. I'd rather not use the list box for other reasons I won't get into here. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Easy to get handle from listbox. How to get listbox from handle? | .NET General | |||