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

Making the content of the dialogs stretch

4 Answers 114 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
hwsoderlund
Top achievements
Rank 1
hwsoderlund asked on 02 Feb 2011, 11:01 AM
I am using my own implementation of ISchedulerDialogHostFactory to make some of the dialog windows resizable. When I resize the "edit appointment" window, for example, the content of the window does not stretch properly. See the attached screen shot. Is there anything we can do to work around this ourselves, or would you have to adjust your template?

4 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 03 Feb 2011, 10:01 AM
Hello Henrik,

What are the values of HorizontalContentAlignment and VerticalContentAlignment of RadWindow instance that you are using?
Also if you could provide us the template (for RadWindow) that you use it will be much easier to identify the problem.

Greetings,
Hristo
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
hwsoderlund
Top achievements
Rank 1
answered on 03 Feb 2011, 10:56 AM
The problem is exactly the same even when using the default OfficeBlack theme. See the attached screen shot. And I am pasting my current dialog factory code. I have tried setting the content alignment properties all over the place, but they do not seem to make a difference:

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using GLS.Gui.Helper;
 
namespace GLS.Gui.Controls.Scheduling
{
    internal class GLSSchedulerWindowFactory : ISchedulerDialogHostFactory
    {
        ISchedulerDialogHost ISchedulerDialogHostFactory.CreateNew(ScheduleViewBase scheduleView, DialogType dialogType)
        {
            var dialogContent = new SchedulerDialog();
            dialogContent.HorizontalAlignment = HorizontalAlignment.Stretch;
            dialogContent.VerticalAlignment = VerticalAlignment.Stretch;
            dialogContent.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            dialogContent.VerticalContentAlignment = VerticalAlignment.Stretch;
 
            //Default size
            var dimensions = new Point(240, 320);
 
            switch (dialogType)
            {
                case DialogType.ConfirmationDialog:
                case DialogType.RecurrenceChoiceDialog:
                    dimensions.X = 240;
                    dimensions.Y = 140;
                    break;
                default:
                    break;
            }
 
            dialogContent.MinWidth = dimensions.X;
            dialogContent.MinHeight = dimensions.Y;
 
            SchedulerWindow schedulerWindow = new SchedulerWindow
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalContentAlignment = VerticalAlignment.Stretch,
 
                ResizeMode = Telerik.Windows.Controls.ResizeMode.CanResize,
                WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen,
                ScheduleView = scheduleView,
                Content = dialogContent,
            };
 
            //schedulerWindow.Style = ResourceHelper.GetAppStyle("RadWindowPortalStyle");
 
            return schedulerWindow;
        }
    }
}
0
Accepted
Pana
Telerik team
answered on 08 Feb 2011, 02:49 PM
Hello,

The default style for SchedulerDialog has Width defined. Try to set dialogContent's Width to Auto.

All the best,
Pana
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
hwsoderlund
Top achievements
Rank 1
answered on 09 Feb 2011, 09:31 AM
Yep, that was it. It works now. Thanks.
Tags
ScheduleView
Asked by
hwsoderlund
Top achievements
Rank 1
Answers by
Hristo
Telerik team
hwsoderlund
Top achievements
Rank 1
Pana
Telerik team
Share this question
or