Making the content of the dialogs stretch

5 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 02 Feb 2011 Link to this post

    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?

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 03 Feb 2011 Link to this post

    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>>
  3. DevCraft banner
  4. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 03 Feb 2011 Link to this post

    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;
            }
        }
    }
  5. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 08 Feb 2011 Link to this post

    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>>
  6. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 09 Feb 2011 Link to this post

    Yep, that was it. It works now. Thanks.
Back to Top
DevCraft banner