1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Control Designer with Multi-line Textbox

Control Designer with Multi-line Textbox

7 posts, 0 answered
  1. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    05 Nov 2007
    Link to this post
    I have a control designer that uses a multi-line textbox.  It works fine when posting new content.

    However, if I revisit the control designer and just hit "I'm done" without making changes it rips out all of the "new lines" that I might've typed into my multi-line textbox.  It just becomes one long line of text.

    The reason for this (I think) is that my multi-line textbox only kicks into action when it's updated.  If this textbox isn't updated, then Sitefinity gets the control properties from the "Advanced" tab.  That textbox is single line.

    I experimented by decorating my property with:

    [Browsable(false)]

    That got rid of the "Advanced" textbox, but it also made my multi-line control designer textbox cease working.

    How should I got about accomplishing this so that my "new lines" are maintained?

    Thanks as always,

    Gabe
    ==============
  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    05 Nov 2007
    Link to this post
    Hello Gabe,

    We are currently looking into this problem. As soon as we find something, we'll let you know.
    Sorry for the inconvenience caused.

    Regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    09 Nov 2007
    Link to this post
    Hi Gabe,

    I will try to explain the cause of the problem. For example, if you enter the following text in MultiLine textbox :
    test after test
    test
    test


    In the database, the data is saved as three rows:
    test after test
    test
    test


    So when you switch to Advanced mode, SingleLine textbox will display just the first row and that causes the problem i.e. test after test.

    As a workaround, I would suggest you enter the text without breaks in order to be saved as one row.

    Hope this helps.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    09 Nov 2007
    Link to this post
    Pepi,

    Thank you for an explaination of the problem.

    Given the nature of the Control Designer I am trying to create "don't enter text with breaks" isn't really an option.  However, once submitted I might be able to convert the breaks to something else for storage purposes.  Then, when the control is rendered, I will have to convert it back to breaks. 

    This isn't ideal, but it will probably work.  I noticed RadEditor turns code into one long line (with no breaks).  I guess this is why it does that.  :)

    As always, thank you for your help!

    Gabe
    ==============
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    12 Nov 2007
    Link to this post
    Hi Gabe,

    The provided workaround is to help you solve the problem for the time being. We plan to figure out a more acceptable and intuitive solution of the described scenario for future releases.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    12 Nov 2007
    Link to this post
    Hi Pepi,

    I don't see an attachment for your post; should there be one?

    As an aside, I came up with my own (hacky) work-around to this problem and made it a part of my "Format Code" control.

    The "Format Code" control, along with various other control examples, can be downloaded here:

    http://goondocks.com/projects/goondocks-sitefinity-controls.aspx

    I would love to see your solution however, so please share when you have an opportunity.  Thanks Pepi.

    Gabe
    ================
  7. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    12 Nov 2007
    Link to this post
    Hello Gabe,

    Sorry for not making myself clearer. What I meant is the workaround I suggested in my reply of 11/09.
    Thanks for providing yours, we'll definitely have a look at that and will continue searching for a solution.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
7 posts, 0 answered