Listview固定标题/左列

时间:2014-08-26 16:20:57

标签: html css asp.net

我已经交了一些ASP.NET代码,并负责修复它包含的可滚动网格的标题和第一列。

我发现许多关于修复标题/列的帖子(例如Table fixed header and first column css/html / Html table with fixed header column and row without JS / How to freeze header and left columns of the table),但我无法将它们成功应用到我的代码中。你能提供的任何帮助都很棒。

<asp:Content ID="Content1" ContentPlaceHolderID="bodyContent3" runat="server">
<asp:UpdatePanel ID="mainPanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:Panel ID="Panel1" runat="server" >
            <asp:ListView>
                <LayoutTemplate>
                    <table id="table1" class="tblstyle1">
                        <thead>
                            <tr>
                                <th>th A</th>
                                <th>th B</th>
                                <th>th C</th>
                                <th>th D</th>
                                <th>th E</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr runat="server" id="itemPlaceholder"></tr>
                        </tbody>
                    </table>
                </LayoutTemplate>

                <ItemTemplate>
                    <tr>
                        <td>td content 1</td>
                        <td>td content 2</td>
                        <td>td content 3</td>
                        <td>td content 4</td>
                        <td>td content 5</td>
                    </tr>
                    <div runat="server" id="xyz">
                        <asp:Repeater runat="server" ID="abc">
                            <HeaderTemplate>
                                <ul>
                            </HeaderTemplate>
                            <FooterTemplate></ul></FooterTemplate>
                            <ItemTemplate>
                                <li><%#:xyz %></li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                </ItemTemplate>

                <EditItemTemplate>
                    <tr>
                        <td>td content 1</td>
                        <td>td content 2</td>
                        <td>td content 3</td>
                        <td>td content 4</td>
                        <td>td content 5</td>
                    </tr>
                </EditItemTemplate>

                <InsertItemTemplate>
                    <tr>
                        <td>td content 1</td>
                        <td>td content 2</td>
                        <td>td content 3</td>
                        <td>td content 4</td>
                        <td>td content 5</td>
                    </tr>
                </InsertItemTemplate>
            </asp:ListView>
        </asp:Panel></table>
    </ContentTemplate>
</asp:UpdatePanel>
</div>

0 个答案:

没有答案