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. Web Development
  3. ASP.NET
  4. Filtering a GridView on a column using checkboxes

Filtering a GridView on a column using checkboxes

Scheduled Pinned Locked Moved ASP.NET
question
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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I have a GridView which is showing a number of records. Each record can be grouped by a column called "Status" and there are several possible status values, e.g. New, Open, Closed, Deferred, etc. I've added a drop-down list and a button which allows me to choose one status value to be displayed in the list. I do this by setting the .FilterExpression property on my GridView and this works great. However, now there are loads of records on the system, I really need to be able to apply one or *more* status values to filter the GridView on. So I'd like to be able to choose, say, "New" and "Deferred". I started off by adding a number of checkboxes, one for each possible status with the idea that I'd read the values and build a suitable filter expression but it's really clumsy looking. What I'm looking for is a more elegant way of building up my FilterExpression string using checkboxes. Can anyone suggest an approach? Thanks - and have a great weekend :)

    T 1 Reply Last reply
    0
    • L Lost User

      Hi, I have a GridView which is showing a number of records. Each record can be grouped by a column called "Status" and there are several possible status values, e.g. New, Open, Closed, Deferred, etc. I've added a drop-down list and a button which allows me to choose one status value to be displayed in the list. I do this by setting the .FilterExpression property on my GridView and this works great. However, now there are loads of records on the system, I really need to be able to apply one or *more* status values to filter the GridView on. So I'd like to be able to choose, say, "New" and "Deferred". I started off by adding a number of checkboxes, one for each possible status with the idea that I'd read the values and build a suitable filter expression but it's really clumsy looking. What I'm looking for is a more elegant way of building up my FilterExpression string using checkboxes. Can anyone suggest an approach? Thanks - and have a great weekend :)

      T Offline
      T Offline
      thowra
      wrote on last edited by
      #2

      Try CheckBoxList You can iterate through the list and get the text value of each item whose Checked value is True.

      Evil cannot be conquered in the world... It can only be resisted within oneself.

      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