ListView.SelectedIndexChanged fired too much
-
I am using the ListView.SelectedIndexChanged to update data, when a new item has been selected. My problem is, that the event will be fired for each new selected (de-selected) item (if multiSelect is true; more than twice). [And i don't want to get the data from the database each time.] Is there an event that will be raised if the control has finished handling these processes (or processes for this control at all)? Or does anyone have another idea to solve thsi problem
-
I am using the ListView.SelectedIndexChanged to update data, when a new item has been selected. My problem is, that the event will be fired for each new selected (de-selected) item (if multiSelect is true; more than twice). [And i don't want to get the data from the database each time.] Is there an event that will be raised if the control has finished handling these processes (or processes for this control at all)? Or does anyone have another idea to solve thsi problem
C-Scharbe wrote:
Is there an event that will be raised if the control has finished ...
No. The Control can not guess when you have finished selecting and de-selecting, so the only thing it can do is fire every time. Either apply code that can stand this, or add some way for the user to confirm the selection process is done, e.g. a button. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
C-Scharbe wrote:
Is there an event that will be raised if the control has finished ...
No. The Control can not guess when you have finished selecting and de-selecting, so the only thing it can do is fire every time. Either apply code that can stand this, or add some way for the user to confirm the selection process is done, e.g. a button. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
It's too complicate... ... for the user to click an extra button :) I missing something like LastSelectedIndexChanged or AfterSelectedIndexChanged.
It's too complicate... ... for the computer to read the user's mind X|
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
It's too complicate... ... for the computer to read the user's mind X|
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
Perhaps he could use classes from the DWIM namespace...
Regards, mav -- Black holes are the places where God divided by 0...
-
Perhaps he could use classes from the DWIM namespace...
Regards, mav -- Black holes are the places where God divided by 0...
Unfortunately a lot of methods in System.DWIM throw a NotImplementedException. :-D
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
Perhaps he could use classes from the DWIM namespace...
Regards, mav -- Black holes are the places where God divided by 0...
-
Unfortunately a lot of methods in System.DWIM throw a NotImplementedException. :-D
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
I am using the ListView.SelectedIndexChanged to update data, when a new item has been selected. My problem is, that the event will be fired for each new selected (de-selected) item (if multiSelect is true; more than twice). [And i don't want to get the data from the database each time.] Is there an event that will be raised if the control has finished handling these processes (or processes for this control at all)? Or does anyone have another idea to solve thsi problem