hi
I want to sort the Recordgrid on Pointerenvelop event,but PointerEnvelopEvent consuming the default sorting event of RecordGrid.Columns are sorted for the first time
after that it is not getting sort.
Thanks
Which object are you attempting to install a PointerEnvelopeEvent handler on? Where is the user clicking to cause a sort?
I'm not exactly clear on the question, or what the use case is here.
Hi,
On PointerEnvelopEvent record selection is enabled and on
SelectionChanged some procedure gets called, which is consuming PointerEnvelopEvent.
So First time if i click on recordgrid column header then it will sort ,and record selection gets enabled.
but next time click on column-header then PointerPress is getting called it will execute SelectionChange code and sorting wont work.
{RecordGrid
select-current-record? = false,
{on e:PointerEnvelopeEvent at rg:RecordGrid do
{type-switch e.contents
case pp:PointerPress do
set rg.select-current-record? = true
........
case pr:PointerRelease do
........
}
},
{on e:SelectionChanged do
{some procedure.....}
}
}
Thanks
Varsha
Well, selection is changing, since you are causing a record to be selected, and then changing the sort order and resetting the current index.
But I tried a version of your example and it had no issues with sorting, first time or later. I suspect something else is going on outside of the code that you posted. Perhaps you are changing the graphical hierarchy in the middle of event handling, causing something unexpected to happen? Normally, the sort is controlled by a regular click (press+release) over a column selector, so happens on PointerRelease. If you are somehow causing the grid to be rebuilt between PointerPress and PointerRelease, that could affect the result -- but I don't see anything in your example that indicates that would be happening.
Thanks Carl for your reply. ![]()
On PointerRelease recordgrid is getting modified
Is there any way so that i can get PointerPress / PointerRelease of RecordGrid's Header?
I mean could identify PointerRelease was on Column-Header of RecordGrid?
Thanks
Varsha
When you get a PointerEvent you get the coordinates where the event occurred. You can use it to determine if the pointer was fired at the header or not.
