Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   ASP (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=187)
-   -   Get record count from a Gridviews sqldatasource after filtering (http://www.dreamweaverclub.com/forum//showthread.php?t=50072)

Donnieclark 05-09-2017 01:16 PM

Get record count from a Gridviews sqldatasource after filtering
 
28 Points
998 Posts
Get record count from a Gridviews sqldatasource after filtering
Dec 23, 2008 04:25 PM|LINK

I'm trying to get a row count from a Gridviews sqldatasource after filtering, but the count returns the value before filtering.

This filtering works but if I use e.AffectedRows shown below even after filtering it still shows the total rows returned before filtering.

FilterExpression="LastName Like '%{0}%' AND FirstName Like '%{1}%'"
<FilterParameters>
<asp:ControlParameter ControlID="LastNameTextBox" DefaultValue="%" Name="LastName" PropertyName="Text" />
<asp:ControlParameter ControlID="FirstNameTextBox" DefaultValue="%" Name="FirstName" PropertyName="Text" />
</FilterParameters>

To get the TOTAL records returned this works, but it is NOT the filtered row count
Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEvent Args) Handles sdsViewCMEs.Selected
lblWarning.Text = e.AffectedRows & " rows returned"
End Sub

Any idea


All times are GMT. The time now is 08:29 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com