This is a migrated thread and some comments may be shown as answers.

How to customize Alert window 's Width?

4 Answers 303 Views
Window
This is a migrated thread and some comments may be shown as answers.
redstar
Top achievements
Rank 1
redstar asked on 25 Apr 2011, 06:14 AM
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?

4 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 27 Apr 2011, 11:11 AM
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
0
redstar
Top achievements
Rank 1
answered on 11 May 2011, 07:30 AM
Thanks!
0
Edwin Kwok
Top achievements
Rank 1
answered on 21 Jul 2011, 04:28 PM
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);
0
Konstantina
Telerik team
answered on 26 Jul 2011, 04:13 PM
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!

Tags
Window
Asked by
redstar
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
redstar
Top achievements
Rank 1
Edwin Kwok
Top achievements
Rank 1
Share this question
or