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

Auto resize MVC Window

3 Answers 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lasse
Top achievements
Rank 1
Lasse asked on 21 Feb 2011, 03:26 PM

Is there any way to automatically resize an MVC (3) Telerik Window, according to the size of the contents of the window?

I have a "Photo Preview Window" with an image inside it that differs in size, depending on which image wsas clicked in the Telerik Grid.

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 22 Feb 2011, 02:42 PM
Hi Mikkel,

If you want to dynamically set the window size, you can do so by setting the width/height of the .t-window-content element, like this:

$("#Window1 .t-window-content").css({ width: image.width, height: image.height });

Auto-sizing is possible only for the first load of the window (by not setting its width/height from the server).

Greetings,
Alex Gyoshev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Alapan
Top achievements
Rank 1
answered on 13 Mar 2013, 03:56 PM
Hi Alex,

I want to capture resize event of Telerik MVC window. I am creating telerik window using client side api.

Can you please help me.

var windowElement = $.telerik.window.create({
             title: "Details",
             contentUrl: url,
             modal: false,
             resizable: true,
             draggable: false,
             scrollable: false,
             width: $(window).width() - 150,
             height: $(window).height() - 350,
             visible: false,
             onRefresh: $(this)._pickEntityWindowOpened,
             onClose: function () {
                 alert('close');
                 windowElement.destroy();
             }
         }).data('tWindow').center().open();
 
         
0
Alex Gyoshev
Telerik team
answered on 14 Mar 2013, 08:32 AM
Hello Alapan,

The resize event is not supported in the Telerik Extensions for ASP.NET MVC Window component. You can refer to the Kendo UI window widget which has it.

Greetings,
Alex Gyoshev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
General Discussions
Asked by
Lasse
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Alapan
Top achievements
Rank 1
Share this question
or