我正在尝试使用我的 asp.net gridview 进行工作。我已经按照互联网上的每个 ASP.NET 指南进行操作,但似乎没有任何效果。
Gridview ASP 标记
<asp:GridView ID="GridView1" runat="server" CssClass="footable" AutoGenerateColumns="false" OnRowCommand="GridView1_RowCommand" DataKeyNames="ClientID" DataSourceID="SqlDataSource1" Style="max-width: 1024px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="ClientID" HeaderText="Client ID" InsertVisible="False" ReadOnly="True" SortExpression="ClientID" />
<asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" />
<asp:BoundField DataField="Suburb" HeaderText="Suburb" SortExpression="Suburb" />
<asp:BoundField DataField="MobileNumber" HeaderText="Mobile Number" SortExpression="MobileNumber" />
</Columns>
</asp:GridView>
代码隐藏文件
GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
GridView1.HeaderRow.Cells[0].Attributes["data-class"] = "expand";
GridView1.HeaderRow.Cells[2].Attributes["data-hide"] = "phone, tablet";
JS
<script type="text/javascript">
$(function () {
$('[id*=GridView1]').footable();
});
如果有人有任何想法,那将是惊人的。