Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Window > RadWindow Confirm and Alert content doesn't word-wrap

Not answered RadWindow Confirm and Alert content doesn't word-wrap

Feed from this thread
  • Jarred Froman avatar

    Posted on Mar 22, 2010 (permalink)

    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.

    Reply

  • Pana Pana admin's avatar

    Posted on Mar 25, 2010 (permalink)

    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.

    Reply

  • Marc Roussel Master avatar

    Posted on Mar 23, 2011 (permalink)

    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);
            }
        }));

    Reply

  • Pana Pana admin's avatar

    Posted on Mar 25, 2011 (permalink)

    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

    Reply

  • Marc Roussel Master avatar

    Posted on Mar 25, 2011 (permalink)

    That's good.  very cool
    Thank you

    Reply

  • John Master avatar

    Posted on Aug 17, 2011 (permalink)

    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.

    Reply

  • Pana Pana admin's avatar

    Posted on Aug 19, 2011 (permalink)

    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 >>

    Reply

  • John Master avatar

    Posted on Aug 29, 2011 (permalink)

    No problem, I understand...
    Thanks.

    Reply

  • Goran avatar

    Posted on Jan 28, 2012 (permalink)

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

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

    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.

    [quote]Some time ago we have considered not to change that behavior. [/quote]

    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

    Reply

  • Goran avatar

    Posted on Jan 28, 2012 (permalink)

    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.

    Reply

  • Pana Pana admin's avatar

    Posted on Jan 30, 2012 (permalink)

    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 >>

    Reply

  • Goran avatar

    Posted on Jan 30, 2012 (permalink)

    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.

    Reply

  • Pana Pana admin's avatar

    Posted on Feb 2, 2012 (permalink)

    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 >>

    Reply

  • Max avatar

    Posted on Apr 3, 2012 (permalink)

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Window > RadWindow Confirm and Alert content doesn't word-wrap
Related resources for "RadWindow Confirm and Alert content doesn't word-wrap"

Silverlight Window Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]