I have a datagrid control that has paging set up and working. What I would
like is a total record count (not just per page) in the header or near the
header of the datagrid.
Here's my code:
<asp:DataGrid
AllowCustomPagi ng="false"
AllowPaging="tr ue"
AllowSorting="t rue"
AlternatingItem Style-BackColor="#EFE FEF"
AutoGenerateCol umns="false"
Border="0"
Cellpadding="4"
Cellspacing="0"
CssClass="DataG rid"
DataKeyField="c lnGUID"
Enabled="true"
EnableViewState ="true"
HeaderStyle-BackColor="Blac k"
HeaderStyle-Font-Bold="True"
HeaderStyle-ForeColor="Whit e" id="DataGrid2" runat="server"
ShowFooter="fal se"
OnSortCommand=" SortCommand_OnC lick"
OnPageIndexChan ged="PageIndexC hanged_OnClick"
PageSize="50"
PagerStyle-Mode="NumericPa ges"
PagerStyle-HorizontalAlign ="Right"
ShowHeader="tru e"
Protected _sqlStmt As String = _
"SELECT cols FROM tables"
Sub Page_Load(Sourc e As Object, E As EventArgs)
If Not Page.IsPostBack Then
BindData()
End If
End Sub
Sub BindData()
Dim conString As String = "server=server; database=db;uid =user;pwd=pwd;"
Dim myDataSet1 As New DataSet
Dim myDataAdapter1 As New SqlDataAdapter( _sqlStmt, conString)
myDataAdapter1. Fill(myDataSet1 , "CommunitiesT1" )
DataGrid2.DataS ource = myDataSet1.Tabl es("Communities T1")
DataGrid2.DataB ind()
End Sub
--
_____
DC G