Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. dataset

dataset

Scheduled Pinned Locked Moved C#
questiondiscussion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fmardani
    wrote on last edited by
    #1

    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

    B 1 Reply Last reply
    0
    • F fmardani

      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

      B Offline
      B Offline
      bloo2k
      wrote on last edited by
      #2

      -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 mean Dataset.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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups