Dim dr As New Infragistics.Web.UI.DataSourceControls.DataRelation()
' Specify the parent view in the relation
dr.ParentDataViewID = "SqlDataSource_View1"
' Specify the composite key using two columns
dr.ParentColumns = New String() {"FirstName", "LastName"}
' Specify the child view in the relation
dr.ChildDataViewID = "SqlDataSource_View2"
'Specify the composite key in the child data source
dr.ChildColumns = New String() {"FirstName", "LastName"}
' Add the relation to WebHierarchicalDataSource
Me.WebHierarchicalDataSource1.DataRelations.Add(dr)