How to add my own kind of link object to Goview?

The code base is DataSetDemo. I have 2 nodes and I tried to link them together by dragging from node1 to node2. I always get the default basic link. I have a special link class called routelink. I tried to overide goView.OnLinkCreated. Here is my code:

Protected Overrides Sub OnLinkCreated(ByVal evt As Northwoods.GoWeb.GoSelectionEventArgs) MyBase.OnLinkCreated(evt) Dim rl As DataSetMapping.routeLink rl = New DataSetMapping.routeLink(CType(evt.GoObject, GoLink).FromNode, "New Link", "") evt.GoObject = rl End Sub
The code has no error. But it does not help either. I still get the default basic link. Any suggestion? Thanks a lot.

The easiest thing to do is to set GoView.NewLinkPrototype when you initialize the GoView. It needs to be set before the user starts drawing a new link.

If you don't want users to always create instances of the same link class, there is discussion of this topic in the FAQ. Search for "I want to decide dynamically what kind of link to create".

Setting GoView.NewLinkPrototype works! Thank you so much.