Anyway to customize output table?

Last post 02-13-2009, 4:59 AM by cutechat. 6 replies.
Sort Posts: Previous Next
  •  11-18-2008, 6:25 AM 45908

    Anyway to customize output table?

    Hi,
     
    I would like to check if there are any ways to customize the output table that used to display all the uploaded file with remove action?
    For example, before the page display the table, can I dynamically add a column beside the actual file name and that column of data can be edited? so that I can allow users to edit on the file name before save into database.
     
    I will need to allow users to edit on the file name, is this possible to be done by using Ajax Uploader?
    Please advice, Thanks!
  •  11-18-2008, 7:58 AM 45912 in reply to 45908

    Re: Anyway to customize output table?

    Hi,
     
    Please check these properties :
     
    ItemTemplate
    ItemTemplatePosition
    TableHeaderTemplate
     
    Or you can draw a table on the OnPreRender method:
     
    protected override void OnPreRender(EventArgs args)
    {
        base.OnPreRender(args);
        uploaderAttachment1.GetItemsTable().Visible=false;//hide the default table...
        foreach(AttachmentItem item in uploaderAttachment1.Items)
        {
            //fill item info into your custom data list control!
        }
    }
     
    Regards,
    Terry
  •  11-19-2008, 1:30 AM 45930 in reply to 45912

    Re: Anyway to customize output table?

    It works, cool!
    So after I have added my own control using ItemTemplate, how can I get the value back?
  •  11-19-2008, 9:50 AM 45942 in reply to 45930

    Re: Anyway to customize output table?

    Hi,
     
    Please use
     
    TextBox box=(TextBox)uploader1.Items[0].FindControl("yourcontrol");
     
    Regards,
    Terry
  •  11-19-2008, 8:50 PM 45971 in reply to 45942

    Re: Anyway to customize output table?

    Yeah, I have figured it out. Thanks a lot!
  •  02-12-2009, 5:36 AM 48661 in reply to 45971

    Re: Anyway to customize output table?

    I found that more than 1 ItemTemplate is not supported, please see the codes below I have:
     
    <CE:UploadAttachments ID="ceuaFileUpload" unat="seve" MultipleFilesUpload="tue"                                                           
    InsetButtonID="btnUpload" EnableViewState="tue" ShowFileIcons="false" ShowPogessBa="false" ShowCheckBoxes="false" ItemCellStyle-VeticalAlign="Top" TableStyle-Width="500" ManualStatUpload="tue" UploadType="IFame" OnAttachmentAdded="ceuaFileUpload_AttachmentAdded"  ItemTemplatePosition="BefoeCheckBox">                                                                                                                        <ItemTemplate>                                                               
    <asp:TextBox ID="txtDesc" TextMode="MultiLine" unat="seve"></asp:TextBox>                                                                                                                            </ItemTemplate>                                                           
    <ItemTemplate>                                                                                                                           
    <asp:Label ID="lblFileType" unat="seve"></asp:Label>                                                            </ItemTemplate>                                                          
    </CE:UploadAttachments>
     
    There will only one will be displayed after I bind the value in during  OnAttachmentAdded event, please help.
     

  •  02-13-2009, 4:59 AM 48741 in reply to 48661

    Re: Anyway to customize output table?

    Hi,
     
    UploadAttachments only support 1 column of the template.
     
    you can do something like this :
     
    This is part1 <%="</td><td>"%> This is part2
     
    And you need modify the TableHeaderTemplate too.
     
    Regards,
    Terry
View as RSS news feed in XML