【发布时间】:2015-03-28 18:48:40
【问题描述】:
我正在尝试使用 jQuery FooTable 插件在我的 gridview 中实现响应式设计,但在尝试在 gridview 中实现分页时似乎被赶上了。样式似乎中断了,并在我单击第二页时尝试强制使用常规网格视图。最初加载时看起来完全没问题。我该如何解决这个问题?
我的gridview代码如下:
<asp:GridView ID="GV_ProgramByKeyword" runat="server" Visible="false" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="ODS_ProgramByKeyword" CssClass="footable" GridLines="None">
<Columns>
<asp:BoundField DataField="ProgramName" HeaderText="Program" SortExpression="ProgramName" />
<asp:BoundField DataField="CredentialType" HeaderText="Credential" SortExpression="CredentialType" />
<asp:BoundField DataField="CategoryName" HeaderText="Category" SortExpression="CategoryName" />
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" SortExpression="CategoryID" Visible="False" />
<asp:BoundField DataField="CategoryDescription" HeaderText="CategoryDescription" SortExpression="CategoryDescription" Visible="False" />
</Columns>
<EmptyDataTemplate>
No data available now
</EmptyDataTemplate>
<PagerStyle CssClass="gridview-paging" />
</asp:GridView>
这是我填充网格并在后面的代码中调整可扩展标题的地方,点击按钮即可:
protected void LinkBtn_Search_Click(object sender, EventArgs e)
{
//Attribute to show the Plus Minus Button.
GV_ProgramByKeyword.HeaderRow.Cells[0].Attributes["data-class"] = "expand";
//Attribute to hide column in Phone.
GV_ProgramByKeyword.HeaderRow.Cells[1].Attributes["data-hide"] = "phone";
GV_ProgramByKeyword.HeaderRow.Cells[2].Attributes["data-hide"] = "phone";
//Adds THEAD and TBODY to GridView.
GV_ProgramByKeyword.HeaderRow.TableSection = TableRowSection.TableHeader;
GV_ProgramByKeyword.Visible = true;
SearchKeywordHeader.Visible = true;
}
【问题讨论】:
标签: c# jquery asp.net gridview webforms