ラベル resizing の投稿を表示しています。 すべての投稿を表示
ラベル resizing の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

ResizableControlExtender: Allowing only horizontal resizing

Hi; I have a ResizableControlExtender control in my page and I'd like to be able to resize it only in x direction (unlike the one in this forum input text control)

Thanks

Any relations to this code peace?:

<scripttype="text/javascript">
function OnClientClickGrow () {
var rcp = $find('ResizableControlBehavior1');
var size = rcp.get_Size();
rcp.set_Size( { width: size.width*2, height: size.height*2 } );
returnfalse;
}
</script>

Just set the ResizableControlExtender's MinimumHeight and MaximumHeight to the same value.

Joe


:) I've found out but u were faster :)

Thanks...

MinimumHeight="500" MaximumHeight="500"

Resizing a panel using Animation Extender

Hi Everyone,

I have 3 rows of images on my form and each row has 3 images as well. I want to have a effect so that when the user hovers on a row than that row expands itself and the rest of the rows remain the same size.

To do this I used 3 panels and in each panel I inseted a table so as to accomodate the 3 images.

Then to add the Hover effect I used the Animation extender control. The code that I used is given below.

<cc1:AnimationExtenderID="AnimationExtender1"runat="server"TargetControlID="Panel1">

<Animations>

<OnHoverOver>

<ParallelDuration=".1"fps="50">

<ResizeWidth="250"Height="260" />

</Parallel>

</OnHoverOver>

</Animations>

</cc1:AnimationExtender>

However this doesn't seem to work. Any idea about why this is happening. It seems to me that I am making a really basic mistake but I have been trying to make this work for quite some days with no success.

If anyone has any idea what the problem is here please let me know.

Thanks

Hi,

I created a sample that works fine according to your description, please try it:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <table> <tr> <td> <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Add.gif" Height="50" Width="50"/> <ajaxtoolkit:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="Image1"> <Animations> <OnHoverOver> <Parallel Duration=".1" fps="50"> <Resize Width="250" Height="250" /> </Parallel> </OnHoverOver> <OnHoverOut> <Parallel Duration=".1" fps="50"> <Resize Width="50" Height="50" /> </Parallel> </OnHoverOut> </Animations> </ajaxtoolkit:AnimationExtender> </td> <td> <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/edit.gif" Height="50" Width="50"/> <ajaxtoolkit:AnimationExtender ID="AnimationExtender2" runat="server" TargetControlID="Image2"> <Animations> <OnHoverOver> <Parallel Duration=".1" fps="50"> <Resize Width="250" Height="250" /> </Parallel> </OnHoverOver> <OnHoverOut> <Parallel Duration=".1" fps="50"> <Resize Width="50" Height="50" /> </Parallel> </OnHoverOut> </Animations> </ajaxtoolkit:AnimationExtender> </td> <td> <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/delete.gif" Height="50" Width="50"/> <ajaxtoolkit:AnimationExtender ID="AnimationExtender3" runat="server" TargetControlID="Image3"> <Animations> <OnHoverOver> <Parallel Duration=".1" fps="50"> <Resize Width="250" Height="250" /> </Parallel> </OnHoverOver> <OnHoverOut> <Parallel Duration=".1" fps="50"> <Resize Width="50" Height="50" /> </Parallel> </OnHoverOut> </Animations> </ajaxtoolkit:AnimationExtender> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> </div> </form></body></html>

Thanks Raymond that surely helps....

However I have another problem and it will be great if you can have a look at that also....

http://forums.asp.net/p/1168745/1950736.aspx#1950736

Thanks in advance

vishy

Resizing DIV according to collapsiblePanel state

Hello,

I'm trying to resize a div on the moment the collapsiblePanel either expands or collapses.

The page I have is roughly like follows;

1<table>2 <tr>3 <td>4 <div id="cpPanelHeader">5 panel header6 </div>7 <div id="cpPanelContent">8 panel content9 </div>10 <ACT:CollapsiblePanelExtender11 TargetControlID="cpPanelContent"12 ExpandControlID="cpPanelHeader"13 CollapseControlID="cpPanelHeader" />14 </td>15 </tr>16 <tr>17 <td>18 <div id="PageContent">19 main page content20 </div>21 </td>22 </tr>23</table>

the first table cell houses some general information, enclosed in the collapsible panel. the second table cell houses the page content.

on the moment that the collapsible panel collapses or expands i want to make sure the main page content is spread over the available space. therefore i want to be able to set the height property of the PageContent div. I first tried some codebehind to set the style.height of the div, but this prop is read only. then i changed the div into a panel, and set the panel.height prop. this didn't seem to work; the panel did not shrink or grow, no matter what value I set the height to. Then i tried to use client javascript, but i cant get hold of the panelstate inside of the javascript.

Can anyone point out to me how to solve this problem?

Regards,

Francois

Hi Francois,

You can add event handler for the panel's collapsed and expanded event, and resize the div in the handler.

First, assign a behaviorID to the CollapsiblePanelExtender;

Second, retrieve it with $find method;

Third, Add event handler for it;

For instance:

<ajaxToolkit:CollapsiblePanelExtender ID="cpeDemo"BehaviorID="cpe"...... />

function pageLoad()

{

var cpb = $find("cpe");

cpb.add_expanded(myFunction1); cpb.add_collapsed(myFunction2);

}

function myFunction1() {//resize div here}

Hope this helps.


Hello Raymond,

I'm fiddling with your approach. one thing that doesn't work yet is the adding of the event handlers.

the code I have is as follows;

 function OnLoad() { alert('OnLoad'); var cpb = $find('cpBID'); cpb.add_expanded(ResizeDIVOnPanelExpanded); cpb.add_collapsed(ResizeDIVOnPanelCollapsed); } function ResizeDIVOnPanelExpanded() { alert('OnPanelExpanded'); } function ResizeDIVOnPanelCollapsed() { alert('OnPanelCollapsed'); }

I registered this code with the scriptmanager as follows;

protected void Page_Load(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(this,typeof(GS_CasusAanpassen),"start","OnLoad();",true); }

Now, I do get the OnLoad message. but after that it's all quit. is it something I did wrong with adding the event handlers?

Or do I have to set the script on another place?

Kind Regards and thanks for helping out!

Francois


Finally Big Smile

It seems I was hooking up the wrong events. while searching throught the forum I stumbled accross the following thread;

http://forums.asp.net/p/1112899/1721250.aspx#1721250

Following that thread I solved my problem as follows:

 <script language="javascript" type="text/javascript"> function pageLoad() { var cpb = $find("collapsibleBehavior"); cpb.add_expandComplete( ResizeDIVOnPanelExpanded ); cpb.add_collapseComplete( ResizeDIVOnPanelCollapsed ); } function ResizeDIVOnPanelExpanded() { document.getElementById('MainContentDIV').style.height = '250px'; } function ResizeDIVOnPanelCollapsed() { document.getElementById('MainContentDIV').style.height = '500px'; } </script>
This works well. It would be nice thought if the size would change fluently and not at once. a bit like the collapsible panel itself maybe.

Resizing Tab Control to fit contained controls

Hi all,

I must be missing something, but I am having a problem with getting my tab control to fit around all the contained controls. What I am doing is adding some controls during runtime and trying to get them to fit within the tab contained area. So for example:


I have a tab control that contains functionality to search by attribute from a data table. So there are 2 combo boxes, a text box, and a button. When the user selects a value from the combo boxes and enters a value in the text box, then they can press find. When they press find, I set the datasource on a grid to reflect this query and display the grid. The problem is that my grid is being displayed outside of the colored area of my tab control. I am having this same difficulty when I add an accordion of grids to another tab.

I would appreciate any help someone can give me on this subject. I have tried changing my style sheet to include padding settings, but that didn't seem to work (though I may have not set something correctly there).

Thanks in advance.

Hello all,

I recently made a post, but I can't seem to find it now. So sorry for the redundancy of this question.

I have a tab control that I am dynamically adding an accordion to with grids inside each level of the accordion. My problem is that my tab control does not visiby resize to contain the controls that I am dynamically adding to it. Can someone give me an idea on what I might can do to force the tab to redraw to visibly contain these controls? Please tell me if this doesn't describe the problem well enough and I will try to do a better job.

Thanks,
Lee

Resizing the Ajax ResizableControlExtender durning the OnLoad event

I'm having a problem with the Ajax ResizableControlExtender.

The control is around an asp panel, which is around a gridview. The gridview is really wide, and I need the headers to stay at the top when scrolling down. That's working just fine.

I have a body onresize javascript event that resizes the ResizableControlExtender to fit better on the screen whenever the screen is resized.

What I need to do is have the resize event fire on the "OnLoad" event.

But at that time the ResizableControlExtender has not been initialized (or so I suppose) and is undefined at that time.

Is there a way to resize the ResizableControlExtender to the current window size in the page load event?

Thanks.

Chuck Snyder

Hi Chuck,

Based on my understanding, the pageLoad method is fired after all extenders on the page have been initialized. But if it doesn't work with you, please try to use window.setTimeout method to invoke the resize method in pageLoad, so that it will be called asynchronized at later.

For instance:

function pageLoad() { window.setTimeout(resize, 1000); }