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. Other Discussions
  3. The Soapbox
  4. What good is an OnItemChanged-event...

What good is an OnItemChanged-event...

Scheduled Pinned Locked Moved The Soapbox
questionjavascriptcss
23 Posts 8 Posters 35 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.
  • J Offline
    J Offline
    Jorgen Sigvardsson
    wrote on last edited by
    #1

    ...if you cannot change the contents of the grid inside it? The grid control assumes that I do not change the grid in any way. If I had another row as a consequence of editing certain cells within the grid, it crashes, because of stupid assumptions. Who designed this!? (That's a rhetorical question - I know who did, but I'm not going to divulge the name of the control library vendor - I don't want to be ignored in the support forums... I reckon the developers visit CP once in a while - who doesn't?) What is the point of the events if I can't really react on the event? The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero. I should have listened to a former colleague of mine, and picked the other control library.

    -- Kein Mitleid Für Die Mehrheit

    N realJSOPR S J G 5 Replies Last reply
    0
    • J Jorgen Sigvardsson

      ...if you cannot change the contents of the grid inside it? The grid control assumes that I do not change the grid in any way. If I had another row as a consequence of editing certain cells within the grid, it crashes, because of stupid assumptions. Who designed this!? (That's a rhetorical question - I know who did, but I'm not going to divulge the name of the control library vendor - I don't want to be ignored in the support forums... I reckon the developers visit CP once in a while - who doesn't?) What is the point of the events if I can't really react on the event? The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero. I should have listened to a former colleague of mine, and picked the other control library.

      -- Kein Mitleid Für Die Mehrheit

      N Offline
      N Offline
      Nagy Vilmos
      wrote on last edited by
      #2

      Jörgen Sigvardsson wrote:

      What is the point of the events if I can't really react on the event

      It's a bit stoopid innit! Can you not go around it the other way as the event tells you which object has changed? If you address it directly, rather than through the event's reference, can you update the grid?


      Panic, Chaos, Destruction. My work here is done.

      J 1 Reply Last reply
      0
      • N Nagy Vilmos

        Jörgen Sigvardsson wrote:

        What is the point of the events if I can't really react on the event

        It's a bit stoopid innit! Can you not go around it the other way as the event tells you which object has changed? If you address it directly, rather than through the event's reference, can you update the grid?


        Panic, Chaos, Destruction. My work here is done.

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        I only have the grid's public interface to work with. Those methods change the internal state of the control, and that is a no-no because the internal code, that calls my event handler, isn't prepared for those types of side effects. I *think* I can change the values inside cells, but I can't change the cells or rows themselves - cells and rows are allocated dynamically, and when moved, cached pointers in the calling context are invalidated.

        -- Kein Mitleid Für Die Mehrheit

        B 1 Reply Last reply
        0
        • J Jorgen Sigvardsson

          ...if you cannot change the contents of the grid inside it? The grid control assumes that I do not change the grid in any way. If I had another row as a consequence of editing certain cells within the grid, it crashes, because of stupid assumptions. Who designed this!? (That's a rhetorical question - I know who did, but I'm not going to divulge the name of the control library vendor - I don't want to be ignored in the support forums... I reckon the developers visit CP once in a while - who doesn't?) What is the point of the events if I can't really react on the event? The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero. I should have listened to a former colleague of mine, and picked the other control library.

          -- Kein Mitleid Für Die Mehrheit

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          "Good" is a subjective term, and its true value is based entirely on the context of the phrase. "Good" programmers in India - That might be true in a few cases, but generally is considered an "outright lie". "Good" soldiers from France - those are the guys that don't mar the finish on their rifles when they throw them down during a headlong retreat. "Good" software from Microsoft - this is true only if you ask someone from Microsoft. The rest of the world claims this is a "damned lie". "Good" Linux distro - this is based on your ability to tolerate the need to use a command line utility to do things like change the resolution in XWindows. There are other examples but I'm getting bored. Maybe that's a "good" thing...

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          J P 2 Replies Last reply
          0
          • realJSOPR realJSOP

            "Good" is a subjective term, and its true value is based entirely on the context of the phrase. "Good" programmers in India - That might be true in a few cases, but generally is considered an "outright lie". "Good" soldiers from France - those are the guys that don't mar the finish on their rifles when they throw them down during a headlong retreat. "Good" software from Microsoft - this is true only if you ask someone from Microsoft. The rest of the world claims this is a "damned lie". "Good" Linux distro - this is based on your ability to tolerate the need to use a command line utility to do things like change the resolution in XWindows. There are other examples but I'm getting bored. Maybe that's a "good" thing...

            "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
            -----
            "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            J Offline
            J Offline
            Jorgen Sigvardsson
            wrote on last edited by
            #5

            Please elaborate on "Good" in the context of Russian programmers. (I think they're Russians :~)

            -- Kein Mitleid Für Die Mehrheit

            B realJSOPR 2 Replies Last reply
            0
            • realJSOPR realJSOP

              "Good" is a subjective term, and its true value is based entirely on the context of the phrase. "Good" programmers in India - That might be true in a few cases, but generally is considered an "outright lie". "Good" soldiers from France - those are the guys that don't mar the finish on their rifles when they throw them down during a headlong retreat. "Good" software from Microsoft - this is true only if you ask someone from Microsoft. The rest of the world claims this is a "damned lie". "Good" Linux distro - this is based on your ability to tolerate the need to use a command line utility to do things like change the resolution in XWindows. There are other examples but I'm getting bored. Maybe that's a "good" thing...

              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

              P Offline
              P Offline
              pseudonym67
              wrote on last edited by
              #6

              John Simmons / outlaw programmer wrote:

              "Good" Linux distro - this is based on your ability to tolerate the need to use a command line utility to do things like change the resolution in XWindows.

              :laugh: :laugh: :laugh: :laugh: Getting a bit long in the tooth there mate. Personally I hate command line rubbish and have only used it on rare occasions, ( honestly read the book, there is 1 case of using a command line. ) As for XWindows, seriously, I have never seen one. I wouldn't even know how to run one.

              pseudonym67 My Articles[^] Beginning KDevelop Programming[^]

              realJSOPR 1 Reply Last reply
              0
              • J Jorgen Sigvardsson

                ...if you cannot change the contents of the grid inside it? The grid control assumes that I do not change the grid in any way. If I had another row as a consequence of editing certain cells within the grid, it crashes, because of stupid assumptions. Who designed this!? (That's a rhetorical question - I know who did, but I'm not going to divulge the name of the control library vendor - I don't want to be ignored in the support forums... I reckon the developers visit CP once in a while - who doesn't?) What is the point of the events if I can't really react on the event? The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero. I should have listened to a former colleague of mine, and picked the other control library.

                -- Kein Mitleid Für Die Mehrheit

                S Offline
                S Offline
                Shog9 0
                wrote on last edited by
                #7

                Jörgen Sigvardsson wrote:

                The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero.

                I'm fond of SetTimer(hWnd, 0, 0, NULL) myself, but yeah. Short delays to avoid non-reentrant code...

                J 1 Reply Last reply
                0
                • S Shog9 0

                  Jörgen Sigvardsson wrote:

                  The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero.

                  I'm fond of SetTimer(hWnd, 0, 0, NULL) myself, but yeah. Short delays to avoid non-reentrant code...

                  J Offline
                  J Offline
                  Jorgen Sigvardsson
                  wrote on last edited by
                  #8

                  I can't wait for the new features from C++0x: lambda & closures. Then it'll be very easy devise a general mechanism for deferring code execution (independent of the mechanism that starts the execution).

                  -- Kein Mitleid Für Die Mehrheit

                  S 1 Reply Last reply
                  0
                  • J Jorgen Sigvardsson

                    I can't wait for the new features from C++0x: lambda & closures. Then it'll be very easy devise a general mechanism for deferring code execution (independent of the mechanism that starts the execution).

                    -- Kein Mitleid Für Die Mehrheit

                    S Offline
                    S Offline
                    Shog9 0
                    wrote on last edited by
                    #9

                    Yes... I'm looking forward to that as well.

                    1 Reply Last reply
                    0
                    • J Jorgen Sigvardsson

                      I only have the grid's public interface to work with. Those methods change the internal state of the control, and that is a no-no because the internal code, that calls my event handler, isn't prepared for those types of side effects. I *think* I can change the values inside cells, but I can't change the cells or rows themselves - cells and rows are allocated dynamically, and when moved, cached pointers in the calling context are invalidated.

                      -- Kein Mitleid Für Die Mehrheit

                      B Offline
                      B Offline
                      Brady Kelly
                      wrote on last edited by
                      #10

                      There is always the evergreen deferred execution method. Set a timer in OnItemChanged, and have its Timer event execute your code after the event handler has exited. :suss: Oops! :-O I initially skipped over your mention of WM_KICKIDLE.

                      1 Reply Last reply
                      0
                      • J Jorgen Sigvardsson

                        Please elaborate on "Good" in the context of Russian programmers. (I think they're Russians :~)

                        -- Kein Mitleid Für Die Mehrheit

                        B Offline
                        B Offline
                        Brady Kelly
                        wrote on last edited by
                        #11

                        Oh no! I'm using the same suite, particularly the grid, but I don't need no stinking grid manipulation. But still, on the whole, I find their products to be very powerful and configurable, if not altogether intuitive. If you want intuitive and convenient, at the cost of scope for control, I would recommend DevExpress.

                        J 1 Reply Last reply
                        0
                        • B Brady Kelly

                          Oh no! I'm using the same suite, particularly the grid, but I don't need no stinking grid manipulation. But still, on the whole, I find their products to be very powerful and configurable, if not altogether intuitive. If you want intuitive and convenient, at the cost of scope for control, I would recommend DevExpress.

                          J Offline
                          J Offline
                          Jorgen Sigvardsson
                          wrote on last edited by
                          #12

                          DevExpress is .NET only..? :~

                          -- Kein Mitleid Für Die Mehrheit

                          B 1 Reply Last reply
                          0
                          • J Jorgen Sigvardsson

                            DevExpress is .NET only..? :~

                            -- Kein Mitleid Für Die Mehrheit

                            B Offline
                            B Offline
                            Brady Kelly
                            wrote on last edited by
                            #13

                            Yes, but it's not for you anyway - you want control over convenience. Have you posted your issue on the vendor forums? They've been pretty busy with a new release, so my questions in the component specific boards went unanswered, but when I re-posted them in general discussions last night, both were answered this morning. Oh, they're not Russian. ;P

                            J 1 Reply Last reply
                            0
                            • B Brady Kelly

                              Yes, but it's not for you anyway - you want control over convenience. Have you posted your issue on the vendor forums? They've been pretty busy with a new release, so my questions in the component specific boards went unanswered, but when I re-posted them in general discussions last night, both were answered this morning. Oh, they're not Russian. ;P

                              J Offline
                              J Offline
                              Jorgen Sigvardsson
                              wrote on last edited by
                              #14

                              As soon as I get some time to do it. Right now I'm prioritizing my own product, than theirs. After all, I did find a solution. Even creepier, it turned out the error didn't stop with just deferring the execution. If I ended the cell edit using the keyboard (enter typically), it messes the selections up internally. Selected rows are updated accordingly when a new row is added, but the currently selected cell isn't. The selection is deleted, but the pointer is never set to NULL. Then in the next pass, the grid detects that the cell selection isn't NULL, so it tries to delete it. You know where that leads... The solution to the selection error was fairly easy: I just set current cell selection to NULL prior to adding a new cell. :) I bet the bug never shows up if you insert a row non-adjacent to the row of the selected cell. (I don't have time to find out - at the pace I'm currently coding, I will need a new keyboard by the end of March!)

                              -- Kein Mitleid Für Die Mehrheit

                              B 1 Reply Last reply
                              0
                              • J Jorgen Sigvardsson

                                As soon as I get some time to do it. Right now I'm prioritizing my own product, than theirs. After all, I did find a solution. Even creepier, it turned out the error didn't stop with just deferring the execution. If I ended the cell edit using the keyboard (enter typically), it messes the selections up internally. Selected rows are updated accordingly when a new row is added, but the currently selected cell isn't. The selection is deleted, but the pointer is never set to NULL. Then in the next pass, the grid detects that the cell selection isn't NULL, so it tries to delete it. You know where that leads... The solution to the selection error was fairly easy: I just set current cell selection to NULL prior to adding a new cell. :) I bet the bug never shows up if you insert a row non-adjacent to the row of the selected cell. (I don't have time to find out - at the pace I'm currently coding, I will need a new keyboard by the end of March!)

                                -- Kein Mitleid Für Die Mehrheit

                                B Offline
                                B Offline
                                Brady Kelly
                                wrote on last edited by
                                #15

                                Jörgen Sigvardsson wrote:

                                Even creepier, it turned out the error didn't stop with just deferring the execution. If I ended the cell edit using the keyboard (enter typically), it messes the selections up internally. Selected rows are updated accordingly when a new row is added, but the currently selected cell isn't. The selection is deleted, but the pointer is never set to NULL. Then in the next pass, the grid detects that the cell selection isn't NULL, so it tries to delete it. You know where that leads...

                                :~ Sorry, but, rather you than me. ;P

                                1 Reply Last reply
                                0
                                • P pseudonym67

                                  John Simmons / outlaw programmer wrote:

                                  "Good" Linux distro - this is based on your ability to tolerate the need to use a command line utility to do things like change the resolution in XWindows.

                                  :laugh: :laugh: :laugh: :laugh: Getting a bit long in the tooth there mate. Personally I hate command line rubbish and have only used it on rare occasions, ( honestly read the book, there is 1 case of using a command line. ) As for XWindows, seriously, I have never seen one. I wouldn't even know how to run one.

                                  pseudonym67 My Articles[^] Beginning KDevelop Programming[^]

                                  realJSOPR Offline
                                  realJSOPR Offline
                                  realJSOP
                                  wrote on last edited by
                                  #16

                                  As long as they keep recommending it, it's not obsolete. Whenever someone has a problem is Linux, almost every answer starts with the phrase, "Open a terminal window and...". What a crock.

                                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                  -----
                                  "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                                  1 Reply Last reply
                                  0
                                  • J Jorgen Sigvardsson

                                    Please elaborate on "Good" in the context of Russian programmers. (I think they're Russians :~)

                                    -- Kein Mitleid Für Die Mehrheit

                                    realJSOPR Offline
                                    realJSOPR Offline
                                    realJSOP
                                    wrote on last edited by
                                    #17

                                    You think *who* are Russians?

                                    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                    -----
                                    "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                                    J 1 Reply Last reply
                                    0
                                    • realJSOPR realJSOP

                                      You think *who* are Russians?

                                      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                      -----
                                      "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                                      J Offline
                                      J Offline
                                      Jorgen Sigvardsson
                                      wrote on last edited by
                                      #18

                                      The vendor of [un]said grid control.

                                      -- Kein Mitleid Für Die Mehrheit

                                      1 Reply Last reply
                                      0
                                      • J Jorgen Sigvardsson

                                        ...if you cannot change the contents of the grid inside it? The grid control assumes that I do not change the grid in any way. If I had another row as a consequence of editing certain cells within the grid, it crashes, because of stupid assumptions. Who designed this!? (That's a rhetorical question - I know who did, but I'm not going to divulge the name of the control library vendor - I don't want to be ignored in the support forums... I reckon the developers visit CP once in a while - who doesn't?) What is the point of the events if I can't really react on the event? The workaround: Defer the grid changes to a later stage - WM_KICKIDLE is an unsung hero. I should have listened to a former colleague of mine, and picked the other control library.

                                        -- Kein Mitleid Für Die Mehrheit

                                        J Offline
                                        J Offline
                                        JimmyRopes
                                        wrote on last edited by
                                        #19

                                        Jörgen Sigvardsson wrote:

                                        I should have listened to a former colleague of mine, and picked the other control library.

                                        Are you sure the other control library doesn't suffer the same deficiency or perhaps other "unadvertised features"?

                                        Simply Elegant Designs JimmyRopes Designs
                                        Think inside the box! ProActive Secure Systems
                                        I'm on-line therefore I am. JimmyRopes

                                        J 1 Reply Last reply
                                        0
                                        • J JimmyRopes

                                          Jörgen Sigvardsson wrote:

                                          I should have listened to a former colleague of mine, and picked the other control library.

                                          Are you sure the other control library doesn't suffer the same deficiency or perhaps other "unadvertised features"?

                                          Simply Elegant Designs JimmyRopes Designs
                                          Think inside the box! ProActive Secure Systems
                                          I'm on-line therefore I am. JimmyRopes

                                          J Offline
                                          J Offline
                                          Jorgen Sigvardsson
                                          wrote on last edited by
                                          #20

                                          Of course, I can't be sure of that.

                                          -- Kein Mitleid Für Die Mehrheit

                                          J 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