How to change the order in which controls are appearing

Last post 05-07-2009, 3:16 AM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  05-06-2009, 5:26 AM 51870

    How to change the order in which controls are appearing

    I am new to this tool. I would like to change the order in which the controls are displayed. As of now controls are displayed in the following order.
     
    1. Insert button.
    2. List of files.
    3. Cancel button
     
    I would like to change that to the following order.
     
    1. List of files.
    2. Insert button and Cancel button in the same line.
     
    How would I do this? Any help would be appreciated.
     
    BTW, I use Microsoft AJAX Uploader- Evaluation version- Framework 2.0-Csharp-MicrosoftAjax- Framework 2.0
    Application is run from the IIS.
  •  05-06-2009, 9:13 PM 51905 in reply to 51870

    Re: How to change the order in which controls are appearing

    Hi,
     
    Please check the file 'simple-upload-UI.aspx' in the Ajax-Uploader.zip.
     
    If you want to move the upload quque table, currently it always show under the inserbutton.
     
    You can use this way to draw the table by your way : http://ajaxuploader.com/document/scr/create-custom-queue-table.htm
    (you can move the custom queue table to anywhere too)
     
    Regards,
    Terry
     
  •  05-06-2009, 11:17 PM 51906 in reply to 51905

    Re: How to change the order in which controls are appearing

    Thank you for the suggestion, Terry. I followed the link that you specified, but with no success. I made the default queue table visibility false in the Uploader_Prerender event. The event gets triggered correctly, but somehow the default queue is still appearing.  What could be the reason? Please help.
  •  05-07-2009, 12:35 AM 51907 in reply to 51906

    Re: How to change the order in which controls are appearing

    Thanks a lot, Terry. The first example in the following link worked like a charm.
     
    Now, I face another issue. Once all the selected files are uploaded, the list of uploaded files is shown in a seperate table. How shall I change that to a customized queue, just like we did with the list of selected files?
  •  05-07-2009, 3:16 AM 51915 in reply to 51907

    Re: How to change the order in which controls are appearing

    Hi,
     
    Here is another sample for UploadAttachments :
     
    1. <%@ Page Language="C#" %>  
    2. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    4.   
    5. <script runat="server">  
    6.   
    7.     protected override void OnPreRender(EventArgs e)   
    8.     {   
    9.         base.OnPreRender(e);   
    10.   
    11.         //hide the default table   
    12.         UploadAttachments1.GetItemsTable().Visible = false;   
    13.         //bind the grid every times   
    14.         DataGrid1.DataSource = UploadAttachments1.Items;   
    15.         DataGrid1.DataBind();   
    16.         DataGrid1.Visible = UploadAttachments1.Items.Count > 0;   
    17.     }   
    18.        
    19.     protected void DataGrid1_ItemCommand(object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e)   
    20.     {   
    21.         Guid guid = (Guid)DataGrid1.DataKeys[e.Item.ItemIndex];   
    22.         foreach (AttachmentItem item in UploadAttachments1.Items)   
    23.         {   
    24.             if (item.FileGuid == guid)   
    25.             {   
    26.                 if (e.CommandName == "Download")   
    27.                 {   
    28.                     using (Stream str = item.OpenStream())   
    29.                     {   
    30.                         Response.AddHeader("Content-Disposition", "attachment; filename='" + item.FileName+"'");   
    31.                         Response.AddHeader("Content-Length", item.FileSize.ToString());   
    32.                         byte[] buff = new byte[4096];   
    33.                         while (true)   
    34.                         {   
    35.                             int rc = str.Read(buff, 0, buff.Length);   
    36.                             if (rc == 0)   
    37.                                 break;   
    38.                             Response.OutputStream.Write(buff, 0, rc);   
    39.                         }   
    40.                     }   
    41.                 }   
    42.   
    43.                 if (e.CommandName == "Remove")   
    44.                 {   
    45.                     item.Remove();   
    46.                 }   
    47.   
    48.                 break;   
    49.             }   
    50.         }   
    51.     }   
    52.        
    53. </script>  
    54.   
    55. <html xmlns="http://www.w3.org/1999/xhtml">  
    56. <head runat="server">  
    57.     <title>DataGridCS</title>  
    58. </head>  
    59. <body>  
    60.     <form id="form1" runat="server">  
    61.         <div>  
    62.                
    63.             <CuteWebUI:UploadAttachments runat="server" ID="UploadAttachments1" UploadType=Flash>  
    64.             </CuteWebUI:UploadAttachments>  
    65.             <hr />  
    66.             <asp:DataGrid ID="DataGrid1" runat="server" AutoGenerateColumns="false" DataKeyField="FileGuid" OnItemCommand="DataGrid1_ItemCommand">  
    67.                 <Columns>  
    68.                     <asp:BoundColumn DataField="FileGuid" HeaderText="File Guid" />  
    69.                     <asp:BoundColumn DataField="FileName" HeaderText="File Name" />  
    70.                     <asp:BoundColumn DataField="FileSize" HeaderText="File Size" />  
    71.                     <asp:ButtonColumn CommandName="Remove" Text="Remove" />  
    72.                     <asp:ButtonColumn CommandName="Download" Text="Download" />  
    73.                 </Columns>  
    74.             </asp:DataGrid>  
    75.         </div>  
    76.     </form>  
    77.        
    78. </body>  
    79. </html>  
     
    Regards,
    Terry
     
View as RSS news feed in XML