Size windows file pdf

6 posts, 0 answers
  1. sdf
    sdf avatar
    2 posts
    Member since:
    Jun 2010

    Posted 01 Jun 2010 Link to this post

    Hello everybody,

    I am very novice in ASP.NET and telerik and i want to know if it's possible to have a big windows when i click on pdf files in radfileexplorer. (because now window are very small when i open files)
    How can I do this ? 
    I work in asp.net C# and i just use for the moment :

    <telerik:Rafileexplorer ID="RadFileEplorer1" Runat="server" width="100%">  
    </telerik:Rafileexplorer >

    thx


    Sorry for my bad english but i'm french ...
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 03 Jun 2010 Link to this post

    Hi,

    Please find a complete tutorial on how to modify the behavior of the default dialogs of RadFileExplorer in the following KB article:
    Change the behaviors of the embedded dialogs

    Also, if you want to disable the RadWindow popups and open the files using default browser windows you can use the following sample code:
    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientFileOpen="OnClientFileOpen">
    </telerik:RadFileExplorer>
     
    <script type="text/javascript">
        function OnClientFileOpen(oExplorer, args)
        {
            //get the extension of the opened item
            var fileExt = args.get_item().get_extension();
            if (fileExt && fileExt.toLowerCase() == "pdf")
            {
                //cancel the default behavior
                args.set_cancel(true);
                //open new RadWindow
                var oWnd = radopen(args.get_item().get_path(), "RadWindow1");
                //set size to the newly opened RadWindow
                oWnd.setSize(600, 400);
                //if you want to open the PDF file in a new browser window
                //you can use the following code
                //window.open(args.get_item().get_path());
            }
        }
    </script>

    I hope this helps

    Sincerely yours,
    Dobromir
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    5 posts
    Member since:
    Apr 2007

    Posted 05 Jul 2010 Link to this post

    Thanks, It helped me a lot.
  5. Marc
    Marc avatar
    34 posts
    Member since:
    Oct 2007

    Posted 16 Jul 2010 Link to this post

    I have just implemented your suggestion posted here with the JS.  While it works fine in Chrome, in IE8 the RadWindow opens with the PDF, then a new IE window opens with the PDF but then focus is taken back to the window with the RadWindow in it.  The user then must click back to the IE window with the PDF.

    All I want is to not use the RadWindow at all for opening files from the FileExplorer.  Your solution is close, but not ideal in IE.
  6. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 20 Jul 2010 Link to this post

    Hello Marc,

    In case that you don't want to use the RadWindow control, you can check whether the current file is directory or not, and use the window.open method to open the current file. E.g.
    ASPX:
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
      
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
        <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientFileOpen="OnClientFileOpen">
            <Configuration ViewPaths="~/Files" />
        </telerik:RadFileExplorer>
        <script type="text/javascript">
            function OnClientFileOpen(oExplorer, args)
            {
                    var isDirectory = args.get_item().isDirectory();
      
                    if (!isDirectory)
                    {
                        //cancel the default behavior - RadWindow will not show
                        args.set_cancel(true);
                        var itemPath = args.get_item().get_path();
      
                        //if you want to open the PDF file in a new browser window
                        //you can use the following code
                        window.open(itemPath);
                    }
            }
        </script>
        </div>
        </form>
    </body>
    </html>
    Hope this helps.


    Sincerely yours,
    Petio Petkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Marc
    Marc avatar
    34 posts
    Member since:
    Oct 2007

    Posted 02 Aug 2010 Link to this post

    That worked, thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017