Ticket T330296
Visible to All Users

RichEditorControl - IF command statements

created 9 years ago

Hi
How can I insert an "IF" command profile programmatically ?
My idea is to have a dialog/form where the user can enter 3 values and then insert the code for them if poss.

i.e I want to attach it to a button something like …
{ IF Something = This  "True" "False" }

Im not sure if the (TdxInsertFieldCommand) class covers this…
JEFFD

Answers approved by DevExpress Support

created 9 years ago

Hello Jeff,

Yes, the TdxInsertFieldCommand descendant action should help you create this IF statement template. You can use the approach I provided in the T322841 ticket to accomplish this task. The user just needs to change the Something and This statements to required values to complete the creation of the statement.

    Show previous comments (5)
    DevExpress Support Team 9 years ago

      Hello Jeff,

      I have found a solution that should help you accomplish this task. The key is to use the "new line" character in the IF expressions. Attached is a small sample project (and the corresponding RTF document) demonstrating the command that can arrange fields without gaps.

        Thanks Paulo,
        That seemed to work, except the spaces were still there between lines.
        After some head-scratching I found that you should also highlight the address and set …
        Paragraph/Indents and Spacing/Spacing/Before and After to "0 pt"  (see attached image)
        Then  it  works as expected :)
        Hope this helps someone else.
        Rgds Jeff

        DevExpress Support Team 9 years ago

          Thanks. I am happy to hear that my template document helps.
          You can also set the default value of this Spacing parameter programmatically without calling a dialog. Just change the TdxParagraphStyle(dxRichEditControl1.DocumentModel.ParagraphStyles.DefaultItem).ParagraphProperties.SpacingAfter  property. I hope this information will be of help.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.