By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,685 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,685 IT Pros & Developers. It's quick & easy.

Getting a record count for a filtered datasource

P: n/a
I would like to display the filtered record count for a datasource used to
populate a gridview. I would like to change it every time the filter is
changed.

Is there a way to do this?
Any help is greatly appreciated.
May 31 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Greg Smith" <gj*@umn.eduwrote in message
news:e1**************@TK2MSFTNGP03.phx.gbl...
>I would like to display the filtered record count for a datasource used to
populate a gridview. I would like to change it every time the filter is
changed.

Is there a way to do this?
DataSet MyDS = <create your dataset>;
MyDS.Tables[0].DefaultView.RowFilter = "<apply your filter>";
MyGridView.DataSource = MyDS.Tables[0].DefaultView;
int intRecordCount = MyDS.Tables[0].DefaultView.Count;
--
http://www.markrae.net

May 31 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.