Hello,
I have a custom pin/unpin columns menu in the header. On clicking the item the following gets called.
ultraGridPosition.DisplayLayout.Bands[0].Columns[columnKey].Header.Fixed = true;
but the AfterColPosChanged event does not fire. I need to capture an event when the columns re-arrange on the grid and get the column order.
Thanks,
Vijayan
Hi Vijayan,
Some events only fire in response to user action and do not fire when something is changed in code.
The idea is that if a user changes something, you need an event to tell you that it happened. But if you change something in code, you know you did it and you don't necessarily need an event to tell you.
So typically what you would do in a case like this is take your code out of the AfterColPosChanged event and put it into a method. Then call that method from the AfterColPosChanged event and also from anywhere else in your code that changes the fixed state of a header.
Thanks Mike.
I tried using the function but whats happening is that the function gets called before the column re-arranges and hence the visibleposition value is incorrect.
Say I have 14 columns, the first 4 are pinned and I then pin the 12th column by setting value to the fixed in header in a custom function. I called the other function right after this. But the column is yet to re-arrange and the function executes, giving the incorrect col position value. The column re-arranges later and the event is not fired but the function has already executed. Is there a way I can call the function after the columns re-arrange?
I call the function from both the event handler and the custom pin function.