I'm attempting to get the GroupByRecordPresenter on a child record when the mouse moves over it using the following code: I'm setting this on a style for the DataRecordPresenter
private void OnMouseEnter(object sender, MouseEventArgs e) { RecordPresenter rp = sender as RecordPresenter; if (rp == null) return; Debug.WriteLine("Success!"); GroupByRecordPresenter gbrp = GroupByRecordPresenter.FromRecord(rp.Record) as GroupByRecordPresenter; if (gbrp == null) return; }
However, GroupByRecordPresenter.FromRecord always returns null, even though the GroupByRecordPresenter is loaded and visible in the grid. How can I obtain the GroupByRecordPresenter on mouseover?
Hello Dierk,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your post. I have been looking into it and I can say that GroupByRecordPresenter’s From Record method returns the RecordPresenter of a GroupByRecord, not Record, so I can suggest you use the following code instead of your in order to get the Record’s GroupByRecordPresenter:
DataRecordPresenter drp = sender as DataRecordPresenter; if (drp == null) return; Debug.WriteLine("Success!"); if (drp.Record.ParentRecord != null) { GroupByRecordPresenter gbrp = GroupByRecordPresenter.FromRecord(drp.Record.ParentRecord) as GroupByRecordPresenter; if (gbrp == null) return; }
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.