Hi,
Try the following custom behavior:
class SelectBehavior : ModifyBehavior
{
public SelectBehavior(DiagramView diagramView)
: base(diagramView)
{
}
public override InteractionState StartDraw(PointF point)
{
InteractionState state = base.StartDraw(point);
if (state.CurrentItem == Diagram.Selection &&
Diagram.GetItemAt(point, true) == null)
{
RectangleF bounds = RectangleF.Empty;
if (Diagram.LaneGrid.GetCellFromPoint(point, ref bounds) != null)
return null;
}
return state;
}
}
This behavior removes the multiple selection aspect of the default Modify behavior when the user clicks and drags over the lane grid. The multiple selection still occurs when the click happens outside of the grid.
Assign an instance of this behavior to the DiagramView object:
diagramView1.CustomBehavior = new SelectBehavior(diagramView1);
Finally, in the DiagramView.MouseDown handler do not initiate cell selection if the click was above an item:
...
if ((cell = laneGrid.GetCellFromPoint(point, ref bounds)) != null[b]&&
diagram1.GetItemAt(point, true) == null)
...
Let me know if this helps.
Regards,
Meppy