Extending the TextEdit Control


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I have successfully extended the DevEx TextEdit control for use in my application. It is actually the control that is already extended by SF. When I drop it on a form that already has a primary BO assigned, the BusinessObject property is not set to that BO. The non-extended version of the control will fill this property in properly. How do I add that functionality to my extended control?



Thanks!

Bill
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You can look at the SF source code to see how this is done on the BusinessObject property.  Below is the code:

''' <summary>
''' The business object that is used to bind the data to this field
''' </summary>
''' <value></value>
''' <remarks></remarks>
<Category(EDITOR_CATEGORY), _
DefaultValue(CType(Nothing, Object)), _
Description(EDITOR_BUSINESSOBJECT_DESC)> _
Public Property BusinessObject() As BusinessLayerBase Implements IBusinessBindable.BusinessObject
    Get
        '-- Set the business object to the forms primary business object
        If Not _BusinessObjectEvaluated Then
            _BusinessObjectEvaluated = True
            Try
                BusinessBasics.DefaultBusinessObjectToFormPrimary(Me.DesignMode, _BusinessObject, CType(Me.GetService(GetType(System.ComponentModel.Design.IDesignerHost)), System.ComponentModel.Design.IDesignerHost))
            Catch ex As Exception
            End Try
        End If

        Return _BusinessObject
    End Get
    Set(ByVal value As BusinessLayerBase)
        '-- If the business object is being removed, then make sure it is no longer bound
        If (value Is Nothing) AndAlso (_BusinessObject IsNot Nothing) Then
            Me._BusinessObject.RemoveFromListOfBoundControls(Me)
        End If

        If (Not Me.DesignMode) AndAlso (value IsNot Nothing) Then
            value.AddToListOfBoundControls(Me)
        End If

        _BusinessObject = CType(value, BusinessLayer)
    End Set
End Property


Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
So, if I inherit from MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit do I need to implement IBusinessBindable and IInitializeBusinessObject interfaces in my own extended control?



This is the first control that I have extended. Sorry for my greenhorn questions.

Bill
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
It should already have it implemented, so you may need to override the BusinessObject property to add additional logic to do this.  No problems on the questions, this is how you really learn what goes on under the hood.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search