Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 24, 2013 12:53 PM by cmdevuk
Feb 23, 2013 01:09 PM|LINK
Hey there i have a listview control on a page that will display search results, how would i display the TOTAL amount of records in the label text for lblTotalRecords?
ive tried to put a statement in the databound event in codebehind but that only display the current amount of VISIBLE items i want the TOTAL amount.
Can anyone help?
Feb 23, 2013 09:20 PM|LINK
Thnere may be better ways, but you could do a second listview on the same page (make the listview itsefl not visible) that brings all the records, and then display how many records are in that listview.
Feb 24, 2013 12:53 PM|LINK
Turns out that the easiest way to get the TOTAL count of the Listview Control's Items is as follows:
Dim dv As System.Data.DataView = DirectCast(SqlDataSource1.[Select](DataSourceSelectArguments.Empty), DataView)
Dim resultcount As Integer = Math.Round(dv.Count)
Create a Dataview Object set to the Datasource and then get the record count off that...
Hope this assists anyone else with this issue!