I have been struggling now with this for several hours and for the life of me I cannot figure out how to translate the following C# code to OpenEdge GUI for .NET:
private void ultraDayView1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e)
{
appUIElement = e.Element.GetAncestor(typeof(AppointmentUIElement)) as AppointmentUIElement;
This is not working:
oAppointmentUIElement = e:Element:GetAncestor(Progress.Util.TypeHelper:GetType("Infragistics.Win.UltraWinSchedule.DayView.AppointmentUIElement")).
METHOD PRIVATE VOID ultraDayView_MouseEnterElement( INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UIElementEventArgs ):
DEF VAR appUIElement AS AppointmentUIElement.
appUIElement = e:Element:GetAncestor(Progress.Util.TypeHelper:GetType("Infragistics.Win.UltraWinSchedule.DayView.AppointmentUIElement")).
What am I missing?
Thanks,
-peter
You need to cast it to the proper data type. That's what the as statement is doing.
appUIElement = CAST(e:Element:GetAncestor(Progress.Util.TypeHelper:GetType("Infragistics.Win.UltraWinSchedule.DayView.AppointmentUIElement")),AppointmentUIElement).
Of course! I was staring at the GetAncestor statement all the time, but the problem was not there.
Thanks a lot.