Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ListView.SelectedIndexChanged fired too much

ListView.SelectedIndexChanged fired too much

Scheduled Pinned Locked Moved C#
databasehelpquestionannouncement
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    C Scharbe
    wrote on last edited by
    #1

    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

    L C 2 Replies Last reply
    0
    • C C Scharbe

      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

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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 1 Reply Last reply
      0
      • L Luc Pattyn

        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 Offline
        C Offline
        C Scharbe
        wrote on last edited by
        #3

        It's too complicate... ... for the user to click an extra button :) I missing something like LastSelectedIndexChanged or AfterSelectedIndexChanged.

        L 1 Reply Last reply
        0
        • C C Scharbe

          It's too complicate... ... for the user to click an extra button :) I missing something like LastSelectedIndexChanged or AfterSelectedIndexChanged.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          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.


          M 1 Reply Last reply
          0
          • L Luc Pattyn

            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.


            M Offline
            M Offline
            mav northwind
            wrote on last edited by
            #5

            Perhaps he could use classes from the DWIM namespace...

            Regards, mav -- Black holes are the places where God divided by 0...

            L C 2 Replies Last reply
            0
            • M mav northwind

              Perhaps he could use classes from the DWIM namespace...

              Regards, mav -- Black holes are the places where God divided by 0...

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              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.


              C 1 Reply Last reply
              0
              • M mav northwind

                Perhaps he could use classes from the DWIM namespace...

                Regards, mav -- Black holes are the places where God divided by 0...

                C Offline
                C Offline
                C Scharbe
                wrote on last edited by
                #7

                What is DWIM? Tell me more :) Or send me a link....

                M 1 Reply Last reply
                0
                • L Luc Pattyn

                  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.


                  C Offline
                  C Offline
                  C Scharbe
                  wrote on last edited by
                  #8

                  So there is minimum a throw new Exception("The method or operation is not implemented."); implemented :)!!

                  1 Reply Last reply
                  0
                  • C C Scharbe

                    What is DWIM? Tell me more :) Or send me a link....

                    M Offline
                    M Offline
                    mav northwind
                    wrote on last edited by
                    #9

                    Here's[^] the documentation for the namespace...

                    Regards, mav -- Black holes are the places where God divided by 0...

                    1 Reply Last reply
                    0
                    • C C Scharbe

                      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 Offline
                      C Offline
                      C Scharbe
                      wrote on last edited by
                      #10

                      Does anyone have an idea, to solve this problem??

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups