RadWindow Confirm and Alert content doesn't word-wrap

14 posts, 0 answers
  1. Jarred Froman
    Jarred Froman avatar
    57 posts
    Member since:
    Aug 2008

    Posted 22 Mar 2010 Link to this post

    Release 2010.1

    If you enter a long message in the content of the Confirm or Alert functions for the RadWindow component, the message doesn't word wrap.  It just shows a horizontal scrollbar.
  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 25 Mar 2010 Link to this post

    Hi Jarred,

    Really long messages forced windows to grow to enormous size. You could get window which is 5 times longer than the actual browser width. If you don't want the horizontal scroll bar use as content TextBlock with TextWrapping enabled, Width set to about 400 and Text with the "This is a really long message to show that it doesn't word wrap properly and just shows a scrollbar!" message. If you just set content the ContentPresenter will create TextBlock for it with TextWrapping disabled.

    Best wishes,
    Panayot
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 23 Mar 2011 Link to this post

    Huh ?

    How do you do that if you use this kind of code ? Which the RadWindow is Static
    If I instantiate a RadWindow I loose the Confirm method

    Message = "Ceci va fermer la production courante et créer une sous production.  Désirez-vous continuer ?";

    RadWindow.Confirm(Message, new EventHandler<WindowClosedEventArgs>((s, args) =>
        {
            if (args.DialogResult == true)
            {
                SaveAndStopProduction(MatPre, NbTubes, true, IsItClosingRecoupe, IsContinue, false);
                CopyJob(IsContinue);
            }
        }));
  5. Pana
    Admin
    Pana avatar
    748 posts

    Posted 25 Mar 2011 Link to this post

    Hi Marc,

    You do not "RadWindow.Confirm(string...." but rather "RadWindow.Confirm(UIElement...". Try setting:

    RadWindow.Confirm(new TextBlock() { Text = Message, TextWrapping = TextWrapping.Wrap, Width = 250}, ...

    Note that when you set string as content a TextBlock is generated in the ContentPresenter inside the Control and the TextBlock does not wrap the text by default.

    Best wishes,
    Pana
    the Telerik team
  6. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 25 Mar 2011 Link to this post

    That's good.  very cool
    Thank you
  7. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 17 Aug 2011 Link to this post

    Hello Pana,
    Your trick is working but it would seem logical that this is done by default for strings...
    Because now I have to wrap all the call to Dialog.Confirm in a helper that makes the conversion in case the text gets too long...
    Would you consider changing this by default in the framework ?
    Thank you,
    John.
  8. Pana
    Admin
    Pana avatar
    748 posts

    Posted 19 Aug 2011 Link to this post

    Hello John,

    Some time ago we have considered not to change that behavior. I am sorry for the inconvenience. Using a helper class or an extension method on the RadWindow would be the best solution.

    Kind regards,
    Pana
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  9. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 29 Aug 2011 Link to this post

    No problem, I understand...
    Thanks.
  10. Goran
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 28 Jan 2012 Link to this post

    Hi, We are exploring the capabilities of your silverlight controls, and find this behavior very strange.

    Really long messages forced windows to grow to enormous size. You could get window which is 5 times longer than the actual browser width


    If control is properly designed, this could never happen. If you set maximum width and maximum height for the window, then just use vertical scrollbar for making sure that message it displayed in whole.

    Some time ago we have considered not to change that behavior.


    May I ask what is the reason for this decision? Its not natural to leave to programmer to create a wrapper class for such a simple task, since for every application that is being localized, using RadWindow straight from the box is not possible.


    Thanks,
    Goran
  11. Goran
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 28 Jan 2012 Link to this post

    I see now that in order to support localization, we need to use DialogParameters in order to localize buttons, so making a wrapper is a must. By the way, if you set Header to empty string, it will still display Confirm, probably some kind of bug, you need to enter at least one space.
  12. Pana
    Admin
    Pana avatar
    748 posts

    Posted 30 Jan 2012 Link to this post

    Hi,

    I see why you would think that it is natural for us to put a MaxWidth in the alert/prompt/confirm but also please note that WPF and Silverlight support other content types than strings. If you were to put a UserControl as a Content (which you could and you should be able to do) that have fixed with and height but a little larger than the sizes we have considered normal, It would get constrains from our hardcoded max width / height and you would have hard times getting rid of the scrollbars. And if we are to put these constraints only when the content is string it would get even more magical since the different texts would look fine with different widths in the different languages.

    Regards,
    Pana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  13. Goran
    Goran avatar
    77 posts
    Member since:
    Feb 2011

    Posted 30 Jan 2012 Link to this post

    I agree, but then a way around is to put height constraint on default TextBlock, this way there would be no side effects you are describing.
  14. Pana
    Admin
    Pana avatar
    748 posts

    Posted 02 Feb 2012 Link to this post

    Hello,

    We've already discussed such issues. And we've made our decision. Even if we decide to do it now it will introduce breaking changes.

    Kind regards,
    Pana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  15. Max
    Max avatar
    34 posts
    Member since:
    Dec 2011

    Posted 03 Apr 2012 Link to this post

    How About fork to RadTextAlert or
    RadAlert(params, forceTextWrap=true) and let user care about what he puts in RA controls...
Back to Top
DevCraft banner