How to customize Alert window 's Width?

5 posts, 0 answers
  1. redstar
    redstar avatar
    18 posts
    Member since:
    Feb 2011

    Posted 25 Apr 2011 Link to this post

    My alert text is a little long, that makes Alert window show a Horizontal scroll bar, i don't want to this, so ,how to customize Alert window's Width?
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 27 Apr 2011 Link to this post

    Hello Redstar,

    In order to remove the ScrollBar you can define the Alert as follows:

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

    In that way you replace the ContentPresenter in the Alert with a wrapped TextBlock and the scroll bar should disappear and the text will be aligned.

    Regards,
    Konstantina
    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. redstar
    redstar avatar
    18 posts
    Member since:
    Feb 2011

    Posted 11 May 2011 Link to this post

    Thanks!
  5. Edwin Kwok
    Edwin Kwok avatar
    5 posts
    Member since:
    Dec 2007

    Posted 21 Jul 2011 Link to this post

    Have the same problem, tried your solution with no luck. Any thought?

     string msg = string.Format("My message ({0}), please check and try again.", 
               messageContent);
                        DialogParameters dp = new DialogParameters
                        {
                            Content = new TextBlock 
                                {
                                    Text = msg,
                                    TextWrapping = System.Windows.TextWrapping.Wrap,
                                    Width = 800
                                }
                        };
                        RadWindow.Alert(dp);
  6. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 26 Jul 2011 Link to this post

    Hi Edwin,

    That is because the Width of the TextBlock you have set is far greater than the maximum width of the Alert dialog. That is why the ScrollBar is still visible. If you set it to a value less then 500 the ScrollBar should disappear.

    Hope this helps.

    All the best,
    Konstantina
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
DevCraft banner