PC Review


Reply
Thread Tools Rate Thread

DetailView1.clientHeight too small on resize

 
 
Joe Stateson
Guest
Posts: n/a
 
      15th Oct 2007
I am trying to resize a window to the same size as the DetailView. The
width is just fine, but the height is always slightly too small and I have
to add a constant. I have 4 of these detail views and each one is slightly
too small in height.

<script language="javascript" type="text/javascript">
// <!CDATA[
function formload()
{
var nH = DetailsView1.clientHeight + 100;
var nW = DetailsView1.clientWidth;
window.resizeTo(nW,nH);
}
// ]]>
</script>
</head>
<body onload="formload()">

================================

The window is launched using the following code:

function LaunchInfo(strPageName)
{
var windowAttribs = "toolbar=no,status=no, scrollbars=no,
resizable=no";
window.open(strPageName,"_blank",windowAttribs);
return false;
}



--
======================================================================
Joseph "Beemer Biker" Stateson
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      15th Oct 2007
you need to add in the body margins, padding and border, also for the
DetailsView1 you need to its border and margin. you could also set them
to 0px.

-- bruce (sqlwork.com)




Joe Stateson wrote:
> I am trying to resize a window to the same size as the DetailView. The
> width is just fine, but the height is always slightly too small and I
> have to add a constant. I have 4 of these detail views and each one is
> slightly too small in height.
>
> <script language="javascript" type="text/javascript">
> // <!CDATA[
> function formload()
> {
> var nH = DetailsView1.clientHeight + 100;
> var nW = DetailsView1.clientWidth;
> window.resizeTo(nW,nH);
> }
> // ]]>
> </script>
> </head>
> <body onload="formload()">
>
> ================================
>
> The window is launched using the following code:
>
> function LaunchInfo(strPageName)
> {
> var windowAttribs = "toolbar=no,status=no, scrollbars=no,
> resizable=no";
> window.open(strPageName,"_blank",windowAttribs);
> return false;
> }
>
>
>

 
Reply With Quote
 
Joe Stateson
Guest
Posts: n/a
 
      16th Oct 2007

"bruce barker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> you need to add in the body margins, padding and border, also for the
> DetailsView1 you need to its border and margin. you could also set them to
> 0px.
>
> -- bruce (sqlwork.com)


Thanks bruce, it is a lot easier to just use a constant rather than
calculate those items that are outside of the "client area"

I also found that firefox (unlike IE) could not find
"DetailsView1.clientHeight" when the asp body was below the jscript code
reference but the following worked fine.

function formload()
{
var obj = document.getElementById("DetailsView1");
var nH = obj.clientHeight + 100;
var nW = obj.clientWidth;
window.resizeTo(nW,nH);
}

>
> Joe Stateson wrote:
>> I am trying to resize a window to the same size as the DetailView. The
>> width is just fine, but the height is always slightly too small and I
>> have to add a constant. I have 4 of these detail views and each one is
>> slightly too small in height.
>>
>> <script language="javascript" type="text/javascript">
>> // <!CDATA[
>> function formload()
>> {
>> var nH = DetailsView1.clientHeight + 100;
>> var nW = DetailsView1.clientWidth;
>> window.resizeTo(nW,nH);
>> }
>> // ]]>
>> </script>
>> </head>
>> <body onload="formload()">
>>
>> ================================
>>
>> The window is launched using the following code:
>>
>> function LaunchInfo(strPageName)
>> {
>> var windowAttribs = "toolbar=no,status=no, scrollbars=no,
>> resizable=no";
>> window.open(strPageName,"_blank",windowAttribs);
>> return false;
>> }
>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to programmatically resize the height of a custom IE toolbarwritten in C#? When I resize it, it shrinks but the real-estate it is in staysthe same size. DR Microsoft Dot NET Framework 0 20th Jun 2009 08:02 AM
Shapes Don't resize...redraw to very small Paul Reed Microsoft Powerpoint 2 29th Apr 2008 12:38 PM
OS Partition finally too small, can't resize it Jeje Windows Vista General Discussion 5 11th Jun 2007 02:17 PM
Postbacks and document.body.clientHeight trullock@hotmail.com Microsoft ASP .NET 0 8th Dec 2006 09:08 PM
dialog windows that don't resize but are too small David Diers Windows XP Customization 0 21st Jul 2003 06:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:38 AM.