Problem with RadAsyncUpload in a CommandItemTemplate

5 posts, 0 answers
  1. David
    David avatar
    23 posts
    Member since:
    Jun 2013

    Posted 06 Dec 2013 Link to this post

    I have a RadAsyncUpload control embedded inside a CommandItemTemplate, we are upgrading from RadUpload. My problem is that the button appears in the command strip of the grid, but clicking the button does not bring up the FileOpen dialog. As far as I can tell, nothing happens at all. We are subscribed to the OnItemCommand event but we don't land there when clicking the button. This works OK with the RadUpload control.
    Any suggestions? Code snippet below:

    <CommandItemTemplate>
                            <table class="buttonsTable">
                            <tr>
                            <td class="uploadButton">
                                <telerik:RadAsyncUpload ID="ulIosRedemptionInfo" runat="server"
                                    AllowedFileExtensions="xls"
                                    MaxFileInputsCount="1"
                                    ControlObjectsVisibility="None"
                                    OnClientFileUploaded="clientFileUploaded"
                                    OnFileUploaded="dgdRedemptionFileUploaded">
                                    <Localization Select="Add" />
                                </telerik:RadAsyncUpload>
                                <%--                          
                                <telerik:RadUpload AllowedFileExtensions=".xls" ID="ulIosRedemptionInfo"
                                    runat="server" ControlObjectsVisibility="None"
                                    OnClientFileSelected="iosRedemptionCodeFileSelected">
                                    <Localization Select="Add" />
                                </telerik:RadUpload>
                                --%>
                            </td>
                            <td>
                                <asp:LinkButton ID="lbtnRefresh" runat="server" OnClick="lbtnRefresh_Click" Visible="false"><img style="border:0px;vertical-align:middle;position:relative;padding:0;" alt="" src="<%=this.ResolveUrl("~/Images/toolbar/refresh_grey_16.png")%>" /> Refresh</asp:LinkButton
                                <asp:LinkButton ID="lbtnInspect" runat="server" OnClientClick="showInspectWindow(); return false;" Visible="false"><img style="border:0px;vertical-align:middle;position:relative;padding:0;" alt="" src="<%=this.ResolveUrl("~/Images/toolbar/inspect.png")%>" /> Inspect</asp:LinkButton>                                
                                <asp:LinkButton ID="lbtnDelete" runat="server" Visible="false" OnClick="lbtnDelete_Click"
                                    OnClientClick="return blockConfirm('Are you sure you want to delete these purchase orders?', event, 450, 100,'','Application Policy > Redemption Code');"><img style="border:0px;vertical-align:middle;position:relative;padding:0;" alt="" src="<%=this.ResolveUrl("~/Images/toolbar/delete.png")%>" /> Delete</asp:LinkButton>
                            </td>
                            </tr>
                            </table>
                            </CommandItemTemplate>
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 11 Dec 2013 Link to this post

    Hi David,

    There is no reason for not opening the OpenFile Dialog. Please verify that there are no javascript errors on the page and there are no other html elements rendered over the RadAsyncUpload.

    Regards,
    Hristo Valyavicharski
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    23 posts
    Member since:
    Jun 2013

    Posted 11 Dec 2013 Link to this post

    Turns out the FileOpen dialog does open under Chrome and Firefox - so it may be something in the CSS styling.
  5. David
    David avatar
    23 posts
    Member since:
    Jun 2013

    Posted 11 Dec 2013 Link to this post

    Further turns out that commenting the line for "position: relative" fixes the issue for me - and doesn't materially affect the actual appearance. If you can offer any clues as to why that works it would be appreciated for my own education.

        div.RadUpload .ruButton
        {
            background-image: url('../Images/toolbar/new.png') !important;
            background-position:left bottom;
            background-repeat:no-repeat !important;
            border: solid 0px black;
            text-align: right;
            background-color:transparent;
            font-size:13px;
            cursor:pointer !important;
            display:inline; 
            /*position:relative; */
            padding:0; 
            min-width:50px;
            max-width:50px;
            color:Black; 
            vertical-align:text-bottom !important; 
        }
  6. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 16 Dec 2013 Link to this post

    Hi David,

    Probably there is another element, which is positioned in front of the RadAsyncUpload when "position: relative" is not commented out and click on it instead of the AsyncUpload. Easy way to check that is to use Firefox's built-in Inspector. It has a 3D View and shows all elements in a nice way.

    Regards,
    Hristo Valyavicharski
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017