Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
804
Change width of a webImageViewer
posted

Hi,

do you have a method for setting size and width like setSize() for the webDialogWindow

 

Thanks you

Gabriel Deschenes

  • 4493
    Suggested Answer
    posted

    Hello Gabriel,

    If you want to resize WebImageViewer based on some client properties, you can just do it on the client. This can be achieved by hooking the Initialize client-side event, where you do something like:

    1. Hook the Initilize event:
    <ClientEvents Initialize="wivInit" />

    2. Define the handler:
    function wivInit(ImageViewer, EventArgs)
    {
    ImageViewer.get_element().style.width =
    "800px";
    // or put any other client calculated value
    }

    Or, if want to size it explicitly on the server, you can put WebImageViewer control in an UpdatePanel, or Infragistics WARP, then when you calculate dimensions, and triger updating of that panel. You can ahcieve that with simple ASP.NET Button control inside the UpdatePanel, or marked as Trigger. Then hoking that button's Click server-side event, resize the WebImageViewer. Of course you should also add some hidden input field in which you will record the value you want to set, and read that field's value on the server.

    Hope this helps.