2014-01-23 26 views
0

我有一個列表視圖顯示文件夾在我的文件系統中的多個文件。我要作出這樣的選擇的ListView宛若Dropbox的選擇文件FPR移動,刪除等asp.net c#選擇多個listview entrys像在保管箱

的多個entrys這是我目前的ListView:

<asp:ListView ID="fileListView" runat="server" OnItemCommand="fileListView_OnItemCommand"> 
       <ItemTemplate> 
        <asp:LinkButton id="downloadFile" runat="server" cssclass="fileListTitle" CommandName="downloadFile" CommandArgument='<%# Session["filePath"].ToString() + Eval("fileName").ToString() %>'><img src="img/download.png" class="downloadButton" alt="herunterladen" /><%# Eval("fileName")%></asp:LinkButton> 
<%--    <a class="fileListTitle" href="<%# Session["filePath"].ToString() + Eval("fileName").ToString() %>" target="_blank" > 
        <img src="img/download.png" class="downloadButton" alt="herunterladen" /><%# Eval("fileName")%></a>--%> 
        <asp:Label CssClass="fileListSize" ID="fileSize" runat="server"><%# Eval("size") %></asp:Label> 
        <asp:Label CssClass="fileListDate" ID="creationDate" runat="server"><%# Eval("cDate") %></asp:Label> 
        <div class="fileListMenu"> 
         <asp:LinkButton runat="server" cssClass="fileEditButton" ToolTip="Umbennen" CommandName="renameFile" CommandArgument='<%# Eval("fileName") %>'></asp:LinkButton> 
         <asp:LinkButton runat="server" cssClass="fileDeleteButton" ToolTip="Löschen" CommandName="deleteFile" CommandArgument='<%# Eval("fileName") %>'></asp:LinkButton> 
        </div> 
        <div class="clear"> 
        </div> 
        <br /> 
       </ItemTemplate> 
      </asp:ListView> 

我想同樣的功能,因爲他們在Dropbox的使用,我剛纔挑選了一些entrys: dropbox multiple row select

+0

DropBox使用*很多*的JavaScript。我不希望能夠嚴格使用本機WebForms服務器端控件來模仿其功能。 – David

+0

將一個複選框放入您的ItemTemplate中... – mason

回答

0

所以你寫了一些JavaScript,以便在單擊每一行的時候,一些適當的值是停留在一個陣列和行會突出顯示。如果用戶點擊一個已經突出顯示的行,您將忽略它並從數組中刪除該值。將數組寫入逗號分隔列表,將其粘貼到隱藏字段中,並在表單提交時將逗號分隔列表拆分,以獲取每行所需的值。