SF RichTextbox - Remove RTF metadata when text value is blank or empty


SF RichTextbox - Remove RTF metadata when text value is blank or empty...
Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi all,
When using the SF RichTextbox the control is binded to the Rtf property which is just fine, but if you empty the value in this control, the RTF metadata will be saved with no text and when you need to test if this value is empty, it will fail.

For now what I am doing is testing the RichTextbox1.Text value and saving an empty string if that is the case in the the bo.BeforeSave(), of course if would be nice to have this test be done in this SF RichTextbox  class instead.


    Private Sub BizCompany1_BeforeSave(ByVal e As MicroFour.StrataFrame.Data.BeforeSaveUndoEventArgs) Handles BizCompany1.BeforeSave
        '-- Check if the RTF value is empty, and remove any RTF meta code
        If String.IsNullOrWhiteSpace(Me.RichTextbox1.Text) Then
            Me.BizCompany1.QuickOrderFooter = String.Empty
        End If
    End Sub


Edhy Rijo

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