Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 05-09-2017, 01:16 PM   #1
Join Date: May 2017
Location: UK
Posts: 2
Default 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}%'"
<asp:ControlParameter ControlID="LastNameTextBox" DefaultValue="%" Name="LastName" PropertyName="Text" />
<asp:ControlParameter ControlID="FirstNameTextBox" DefaultValue="%" Name="FirstName" PropertyName="Text" />

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

Last edited by edbr; 05-09-2017 at 03:33 PM..
Donnieclark is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:27 PM.

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