One more approach on top of Trent's suggestion is to bring everything into the Work Orders BO. Greg's already hit on this, the only additional thing you would need to do is create public properties and custom bindable property descriptors so that the BBS will recognize those new fields.
As Trent said, however, doing it this way (pulling everything into a single BO) would only work if the data is meant to be read only. If you want to be able to update the data through the grid, you will need to use Trent's suggestion of the updateable view.
If the grid is read only, and you do want to handle it all via the work orders BO, then your original response to Greg is most of the way there. Once the custom fields are pulled in via your custom query (just like you described in your original reply to Greg), you will need to expose them via public properties on the work order BO:
#Region " Public Properties "
''' <summary>
''' Part Index (Primary Key)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property parts_partindex() As String
Get
Return CType(Me.CurrentRow.Item("parts_partindex"), String)
End Get
End Property
''' <summary>
''' Part Number
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property parts_partnum() As String
Get
Return CType(Me.CurrentRow.Item("parts_partnum"), String)
End Get
End Property
''' <summary>
''' Part Unit Index (Foreign Key)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property parts_unitindex() As String
Get
Return CType(Me.CurrentRow.Item("parts_unitindex"), String)
End Get
End Property
''' <summary>
''' Unit Index (Primary Key)
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property units_unitindex() As String
Get
Return CType(Me.CurrentRow.Item("units_unitindex"), String)
End Get
End Property
''' <summary>
''' Unit Description
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
Public ReadOnly Property units_unitdesc() As String
Get
Return CType(Me.CurrentRow.Item("units_unitdesc"), String)
End Get
End Property
#End Region
And then provide custom property descriptors on the work order BO to access those custom fields:
Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()
Return New FieldPropertyDescriptor() { _
New ReflectionPropertyDescriptor("parts_partindex", GetType(WorkOrderBO)), _
New ReflectionPropertyDescriptor("parts_partnum", GetType(WorkOrderBO)), _
New ReflectionPropertyDescriptor("parts_unitindex", GetType(WorkOrderBO)), _
New ReflectionPropertyDescriptor("units_unitindex", GetType(WorkOrderBO)), _
New ReflectionPropertyDescriptor("units_unitdesc", GetType(WorkOrderBO))}
End Function