【问题标题】:Rendering the gridview pager into the tfoot section of the table将 gridview 寻呼机渲染到表格的 tfoot 部分
【发布时间】:2018-01-11 15:42:12
【问题描述】:

是否可以将网格视图的 asp.net 寻呼机控件放入tfoot 部分?

//Render thead tfoot sections
Private Sub Page_PreRenderComplete(sender As Object, e As EventArgs) Handles Me.PreRenderComplete
  If gv.Rows.Count > 0 Then
    gv.HeaderRow.TableSection = TableRowSection.TableHeader
    gv.FooterRow.TableSection = TableRowSection.TableFooter
  End If
End Sub

//Initiate pager
Protected Sub gv_PageIndexChanging(sender As Object, e As GridViewPageEventArgs) Handles gv.PageIndexChanging
  gv.PageIndex = e.NewPageIndex
  Bind_gv()
End Sub

Pager 自动在表格主体中生成为tr,默认情况下位于底部或顶部(如果指定)。

期望的输出

<table id="gv">
  <thead></thead>
  <tbody>
    //Table data ...
  </tbody>
  <tfoot>
    //Pager here
  </tfoot>
</table

【问题讨论】:

    标签: asp.net vb.net gridview pagination


    【解决方案1】:

    是的,你可以做到。您必须添加以下代码:

    gv.BottomPagerRow.TableSection = TableRowSection.TableFooter
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-11
      • 1970-01-01
      • 1970-01-01
      • 2022-01-02
      相关资源
      最近更新 更多