Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ListView - Multi-Select - The Enigma
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00861463
Message ID:
00870678
Views:
17
I wasn't sure if anyone was interested or not, but I have solved my problem w/ the SelectedIndexChanged on the ListView. The problem, I was having is the SelectedIndexChange was number of times SelectedIndex was firing and when.

I have been using a Listview for navigation, using it to navigate through a Dataset, and depending upon which item in the listview I was selecting I was binding a set of controls ( textboxes and comboboxes etc) to the row in the dataset. The big problem I was running into, is if I was in a textbox and I then selected another item in the Listview. The SelectIndexChanged fired before the Validated event on the textbox, therefore I would be changing the row pointer before the validated fired which actually inserts the data from the text box back into the dataset.

I had to create a few events BeforeSelectedIndexChanged and AfterSelectedIndexChanged, in our base listview class to get around the problem. I fire the events by using the combination of KeyDown, MouseDown and KeyUp, and MouseUp events.

I just thought I would put the solution I had found if anyone was really interested in it.

Morgan


>>Cathi, I thought I would address this to you, because I'm thinking that you have the best chance of having an idea about this.
>>
>>Hopefully, I can articulate my problem well enough to get some help.
>>I have ListView, which I'm using to navigate and display a DataSet's DataTable. I have several controls in a panel below the ListView, and I'm binding those controls to the temporary DataTable. I'm populating the temporary DataTable using the ListView for navigating and getting the data from the DataSet to fill in the temporary DataTable.
>>
>>I can't bind directly to the DataSet with either the ListView or the Controls, because I want to allow for updating multiple rows at a time, by multi-selecting, modifying the values of the controls, and have it update the dataset's appropriate rows.
>>
>>Ok, now to the problem.
>>
>>When, I've selected an item in the ListView, and then fill in the value of a TextBox, and then select another item, I'm getting problems updating the appropriate row. This is because of the order of events, the SelectedIndexChanged on the ListView, fires BEFORE the Validated on the TextBox Control.
>>
>>I've figured out a work around that works for all cases except when the user is using the CTRL key to de-select just one of the ListView items. But, the real question, some other people must have come across this if they are using the ListView for Multi-Selecting and Navigating, what about the MM.NET Framework, how do they get around this problem of events?
>>
>>Any help will be appreciated.
>>
>>Morgan
Previous
Reply
Map
View

Click here to load this message in the networking platform