I'm trying to update a record based on a drag drop, so far the closest thing i've been able to find to determing which record is to be update is by looping through all the records and trying to determin is the records/cards isMouseover is actiave. However both methods i've tried the ismouseover is always false. Is that a bug? Is there another way to determine what card an item was dropped on?
Dim item As Infragistics.Windows.DataPresenter.DataRecordPresenter
item = Infragistics.Windows.DataPresenter.RecordPresenter.FromRecord(dvProjectWbs.Records(i))
item.IsMouseOver
or
dvProjectWbs.Records(1).DataPresenter.IsMouseOver
Good information I used the examples to find the datacard
that I am on but it only seems to work only before I scroll down.
In other word when the app is first run I will mouse over and
it all works great but as soon as I scroll down the mouse over
does not find a IsMouseOver as true
Hello,
I have a similar issue. I'm trying to drag from a XamDataTree to a XamdDataGrid. I am using the drag / drop manager, and MS prism so I do not want to write code-behind in my view. When I capture the drop event and examine the Infragistics.DragDrop.DropEventArgs object, I see the XamDataGrid in the DropTargetElements. This does not help me to determine where to insert the data in my viewmodel. When I drop on a XamDataTree, I get the UI element onto which the drop occurred. How do I know where the drop occurred in the XamDataGrid? I would expect the Drag/Drop Framework to allow me to do this.
Thanks,
Chris
Worked for me:
Record
record = _grid.GetRecordsInView(false).FirstOrDefault<Record>(c => GridHelper.IsMouseOverRecord(c, _grid));
public
static bool IsMouseOverRecord(Record record, Visual grid)
{
try
Point p = MouseHelper.GetMousePosition(grid);
RecordPresenter t = RecordPresenter.FromRecord(record);
System.Windows.
Rect rr = LayoutInformation.GetLayoutSlot(t);
if (rr.IntersectsWith(new Rect(p, new Size(4, 4)))) { return true ; }
}
catch (Exception ex)
...........................
return false;
I just replaced a XamDataGrid with XamDataCards control and it works correctly.
So is this a bug with the datacard? or does someone have another idea? Do i need to submit this as a bug?