UploadAttachments.AttachmentTableStyle Examples?

Last post 03-16-2010, 1:46 PM by senthilkumart. 5 replies.
Sort Posts: Previous Next
  •  06-19-2009, 1:32 PM 53300

    UploadAttachments.AttachmentTableStyle Examples?

    I am new to the AjaxUpload, we are evaluating it for our website. I would greatly appreciate some more info on the following
     
    1. Any examples using the UploadAttachments.AttachmentTableStyle property. What form does the string take?
     
    2. is there a way to control the size of the list/table of files so that a long list of file doesn't 'grow' the whole page but would just scroll within a certain frame/panel?
     
    Thank you in advance for any help.
  •  06-19-2009, 3:56 PM 53313 in reply to 53300

    Re: UploadAttachments.AttachmentTableStyle Examples?

    1. Any examples using the UploadAttachments.AttachmentTableStyle property. What form does the string take?
     

    UploadAttachments.AttachmentTableStyle Property

    Specifies the style for the attachment table.

     
    It's the default value of this property:

    "background-color:#ededed;margin-top:10px;margin-top:10px;font:normal 11px verdana;"

    >>2. is there a way to control the size of the list/table of files so that a long list of file doesn't 'grow' the whole page but would just scroll within a certain frame/panel?

    Put the attachment table into a div.

    <div style="height: 420px; overflow: scroll;">
    ....
    </div>
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-20-2009, 10:37 PM 53324 in reply to 53313

    Re: UploadAttachments.AttachmentTableStyle Examples?

    First thank you for replying.
     
    But I don't understand how I put the div around the attachment table. I can put a div around the uploader itself like so:
     

    <div style="height: 420px; overflow: scroll;">

    <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="UploadAttachments1"

    InsertText="Browse Files (Max 1M)" >

    <VALIDATEOPTION MaxSizeKB="1024" />

    </CuteWebUI:UploadAttachments>

    </div>
     
    But that doesn't put just the attachment table in a scolling div, so could you please give a more in-depth example? Sorry if I am being dense.

    Thanks.

    Mike 
  •  06-23-2009, 10:32 PM 53436 in reply to 53324

    Re: UploadAttachments.AttachmentTableStyle Examples?

    How do I put the attachment table in a div as you suggested? I have tried several things and none have it has worked.
     
    Thanks.
  •  06-23-2009, 10:43 PM 53437 in reply to 53436

    Re: UploadAttachments.AttachmentTableStyle Examples?

    Hi,
     
    For customization , You can create your own table :
     
    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
  •  03-16-2010, 1:46 PM 59434 in reply to 53313

    Re: UploadAttachments.AttachmentTableStyle Examples?

    Adam:
    1. Any examples using the UploadAttachments.AttachmentTableStyle property. What form does the string take?
     

    UploadAttachments.AttachmentTableStyle Property

    Specifies the style for the attachment table.

     
    It's the default value of this property:

    "background-color:#ededed;margin-top:10px;margin-top:10px;font:normal 11px verdana;"

    >>2. is there a way to control the size of the list/table of files so that a long list of file doesn't 'grow' the whole page but would just scroll within a certain frame/panel?

    Put the attachment table into a div.

    <div style="height: 420px; overflow: scroll;">
    ....
    </div>
     
     
     
View as RSS news feed in XML