Getting a record count for a filtered datasource

  • Thread starter Thread starter Greg Smith
  • Start date Start date
G

Greg Smith

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.
 
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;
 
Back
Top