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. Windows Forms
  4. Datagridview

Datagridview

Scheduled Pinned Locked Moved Windows Forms
csshelpquestionlounge
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.
  • P Offline
    P Offline
    phantanagu
    wrote on last edited by
    #1

    Hello eveybody! I have a small question need your help. My datagridview is bound with a dataset contains tblProduct table. A combox allows users choose a Product(B3700, NAPPLE 3'1, NAPPLE 3'2,...) If I filter like this tblProductBingdingSource.Filter = "Product = 'B3700'" . It works well If I repeat tblProductBingdingSource.Filter = "Product = 'NAPPLE 3**'**2'" , it fails to work because of existence of the quote mark. If I replace string "Product = 'NAPPLE 3'2'" with string "Product like 'NAPPLE 3%'", my grid will have this list of unexpected products such as NAPPLE 3'1, NAPPEL 3'2, NAPPLE 3'3,so on. When the users choose a value from combobox such as NAPPLE 3'2, I only have an only product, NAPPLE 3'2. Please help me correct the filtering string. I know the filtering string "Product like 'NAPPLE 3%2'" but the string is not general for all. Thanks in advance Sorry about my English.

    It seem to be a solution or an answer.

    S 1 Reply Last reply
    0
    • P phantanagu

      Hello eveybody! I have a small question need your help. My datagridview is bound with a dataset contains tblProduct table. A combox allows users choose a Product(B3700, NAPPLE 3'1, NAPPLE 3'2,...) If I filter like this tblProductBingdingSource.Filter = "Product = 'B3700'" . It works well If I repeat tblProductBingdingSource.Filter = "Product = 'NAPPLE 3**'**2'" , it fails to work because of existence of the quote mark. If I replace string "Product = 'NAPPLE 3'2'" with string "Product like 'NAPPLE 3%'", my grid will have this list of unexpected products such as NAPPLE 3'1, NAPPEL 3'2, NAPPLE 3'3,so on. When the users choose a value from combobox such as NAPPLE 3'2, I only have an only product, NAPPLE 3'2. Please help me correct the filtering string. I know the filtering string "Product like 'NAPPLE 3%2'" but the string is not general for all. Thanks in advance Sorry about my English.

      It seem to be a solution or an answer.

      S Offline
      S Offline
      SHatchard
      wrote on last edited by
      #2

      You can replace the single quote with two of them which means that it will work, so the search term would be "Product='NAPPLE 3''2'''" Give it a try and post back if you need any help

      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