dataset
-
I am using a dataview to filter a dataset. At first the datagrid is populated with 9 records. This is without a filter. Then I check a checkbox to filter the dataset. This then returns 1 record in the datagrid. Then I uncheck the checkbox and really I want the datagrid to be populated with the initial 9 records but it only populates with just the one as if the filter checkbox is checked. But the count on the dataset at this stage returns 9 and not 1. if a dataset is filtered, then how do I get the initial number of records in the dataset (i.e. prior to filtering)? Any thoughts please? Thanks
-
I am using a dataview to filter a dataset. At first the datagrid is populated with 9 records. This is without a filter. Then I check a checkbox to filter the dataset. This then returns 1 record in the datagrid. Then I uncheck the checkbox and really I want the datagrid to be populated with the initial 9 records but it only populates with just the one as if the filter checkbox is checked. But the count on the dataset at this stage returns 9 and not 1. if a dataset is filtered, then how do I get the initial number of records in the dataset (i.e. prior to filtering)? Any thoughts please? Thanks
-Populate Datagrid: Did you restore dataview's Property 'RowFilter' to the value before filtering when you uncheck the CheckBox. I think you should implement something like this:
DataView.RowFilter=CheckBox.Checked? [Your Filter Expression]:[The original RowFilter Expression(normally empty string)];
in the CheckChanged EventHandle; -Number of Records: did you meanDataset.Tables[index].Rows.Count
.It's independent of on RowFilter property. This number won't change until you Remove a Record from table (Not even Delete) by using Rows.Remove(),Rows.RemoveAt()...functions