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. Visual Studio
  4. Filtring a column with a DataGridView1 only ( withoutaccess or sql)

Filtring a column with a DataGridView1 only ( withoutaccess or sql)

Scheduled Pinned Locked Moved Visual Studio
databasehelp
3 Posts 2 Posters 15 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.
  • U Offline
    U Offline
    User 13579954
    wrote on last edited by
    #1

    Hello everyone, In my application, I have DataGridView1. The DataGridView is not connected at Access or Sql (or others basses). I would like to create a filter from a Textbox3 for column1. My DataGridView1 is filling from Textbox1 & Textbox2 manually. Here my code:(it doesn't work) Sub filtre() Dim DataGridView1 As DataRowView DataGridView1.RowFilter = "Column1 ='Like'%" & TextBox3.Text End Sub Thank you very Much for your help. Have good day.

    Richard DeemingR 1 Reply Last reply
    0
    • U User 13579954

      Hello everyone, In my application, I have DataGridView1. The DataGridView is not connected at Access or Sql (or others basses). I would like to create a filter from a Textbox3 for column1. My DataGridView1 is filling from Textbox1 & Textbox2 manually. Here my code:(it doesn't work) Sub filtre() Dim DataGridView1 As DataRowView DataGridView1.RowFilter = "Column1 ='Like'%" & TextBox3.Text End Sub Thank you very Much for your help. Have good day.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Member 13611972 wrote:

      ='Like'%

      That doesn't look like a valid filter. Try:

      DataGridView1.RowFilter = "Column1 Like '%" & TextBox3.Text & "%'"

      The filter syntax is explained here: DataColumn.Expression Property (System.Data) | Microsoft Docs[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      U 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        Member 13611972 wrote:

        ='Like'%

        That doesn't look like a valid filter. Try:

        DataGridView1.RowFilter = "Column1 Like '%" & TextBox3.Text & "%'"

        The filter syntax is explained here: DataColumn.Expression Property (System.Data) | Microsoft Docs[^]


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        U Offline
        U Offline
        User 13579954
        wrote on last edited by
        #3

        Thank you for your answer. The filter works. ;) Best regards.

        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