Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
290
BeforeColPosChanged/AfterColPosChanged events are not firing when setting Column Header Fixed property
posted

Hi,

I have noticed that the BeforeColPosChanged/AfterColPosChanged events are fired if you click on the "Pin/UnPin" icon in the column headers but are NOT fired when you programmatically set the Header's Fixed property to true/fase.

This same behavior is also true for the BeforeGroupPosChanged/AfterGroupPosChange events for the GridGroup Header.

I, also, noticed that the BeforeGroupPosChanged/AfterGroupPosChange do not fire when the GridGroup's Header is hidden/unhidden which does not match the behavior of the Grid Column's Header.

Not sure if this is a bug or I am not understanding something, but I would beleive that the behavior would be consistent between the different actions!

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    There's really no hard rule about this. Typically, an event fires to let you know that the user did something which you otherwise would not be able to detect.

    If you are changing something in code, you know you did it and you typically do not need an event to tell you that it happened. In a case like this where the event does not fire when something is changed in code, a good approach is to take your code out of the event handler and put it into a method. Then you can call that method from the event handler and from any place else in your code where you make a change.

    Having said that, the control should be consistent with it's own behavior. So if the group headers are behaving differently from column headers, then that is probably an oversight. But... changing the behavior of events is a very dangerous, potentially breaking change, so even if there is a bug there, we tend to err on the side of caution unless the behavior is very bad, rather than change the firing of events.

Reply Children