This is a migrated thread and some comments may be shown as answers.

RadDiagramConnection SourceCapType

7 Answers 120 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 04 Mar 2014, 05:40 AM
I am using the Arrow5Filled and Arrow5 SourceCapType's to differentiate between 2 different join types in my diagram. When a user double clicks the join line I throw up a popup and allow them to enter/edit information about the join. The problem I am facing is that the Arrow5 SourceCapType is not clickable unless you get right on the line (very fiddly), opposed to the Arrow5Filled which is clickable anywhere in the shape. How can I make the Arrow5 SourceCapType to have the same behavior as the Arrow5Filled SourceCapType?

7 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 06 Mar 2014, 11:54 AM
Hello,

I assume that when you say "join line" you actually refer to the RadDiagramConnection control. If so, I think that I understand your scenario.
I tested it in our online demos and it seems that the click event is registered even if you click inside the empty rectangle. Could you please give it a try and let me know if you can reproduce the reported behavior in our demo?

In case that you are not able to reproduce the behavior in the online demo I suggest upgrading to our latest official release.

Regards,
Pavel R. Pavlov
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
Brett
Top achievements
Rank 1
answered on 11 Mar 2014, 10:50 PM
You assume correctly and I am referring to RadDiagramConnection.

I am subscribing to the mouse MouseDoubleClick event. I single click seems to work when I click inside the empty rectangle, however a double click does not work. I cannot really compare it to the demo that you linked me to as it doesnt seem to handle double clicks, only single clicks.
0
Pavel R. Pavlov
Telerik team
answered on 14 Mar 2014, 03:15 PM
Hi Brett,

When you double click on a RadDiagramConnection you actually activate the edit mode of that control. In edit mode you are able to enter text on top of the control.

Regards,
Pavel R. Pavlov
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Brett
Top achievements
Rank 1
answered on 16 Mar 2014, 10:25 PM
I dont think that you are understanding the problem. I double click in the middle of a Arrow5Filled â€‹SourceCapType and the double click event is fired. I double click in the middle of a Arrow5 ​SourceCapType and the double click event is NOT fired. I need the Arrow5 to behave the same as the Arrow5Filled.
0
Zarko
Telerik team
answered on 19 Mar 2014, 04:33 PM
Hi Brett,
The problem is that when you click inside the empty rectangle no mouse event is fired(as far as I tested no doubleClick or mouseDown events) and that's why you'll have to use some thing else. 
I think that the best way to do this is to handle the RadDiagram's MouseDoubleClick event and check if there's a connection around the mouse:
private void OnDiagramMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
    var point = this.diagram.GetTransformedPoint(e.GetPosition(this.diagram));
    var connection = this.diagram.ServiceLocator.GetService<IHitTestService>().GetConnectionsUnderRect(new Rect(point.X - 2, point.Y - 2, 4, 4)).FirstOrDefault();
    if (connection != null)
    {
 
    }
}
(Note: you could try other methods from the hitTestService if you want - GetItemsNearPoint, GetTopItemNearPoint and etc.)
I hope I was able to help you and if you need further assistance feel free to ask.

Regards,
Zarko
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Brett
Top achievements
Rank 1
answered on 19 Mar 2014, 10:05 PM
Hmm not the cleanest solution.

Why does the Arrow5Filled source cap type fire the double click event? Is it because it has a filled background? Would it be possible to customise the Arrow5 source cap type and give it a background color (white) so it works the same way?
0
Zarko
Telerik team
answered on 24 Mar 2014, 04:35 PM
Hi Brett,
Yes, the Arrow5Filled cap fires a double click event because the PathFigure that is generated for it has its IsFilled property set to True. At the moment you can't customize the Arrow5 cap to have a white/transparent background (there's a Customizable Caps feature request in our FeedbackPortal) but you can do this with the Arrow5Filled type - you could always use Arrow5Filled cap but change the connections' background to transparent for some of them. Visually this:
<telerik:RadDiagramConnection Background="Transparent" TargetCapType="Arrow5Filled" />
will look like this:
<telerik:RadDiagramConnection TargetCapType="Arrow5" />
Note: if you se a background to a connection both of its caps will you it as fill color.
I hope I was able to help you and if you have more questions feel free to ask.

Regards,
Zarko
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
Tags
Diagram
Asked by
Brett
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Brett
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or