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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Filter datagridview by a multiline texbox [moved]

Filter datagridview by a multiline texbox [moved]

Scheduled Pinned Locked Moved C#
csharpcssquestion
13 Posts 8 Posters 2 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.
  • J Offline
    J Offline
    Jaasiel
    wrote on last edited by
    #1

    Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

    1 H N E L 6 Replies Last reply
    0
    • J Jaasiel

      Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

      1 Offline
      1 Offline
      1 21 Gigawatts
      wrote on last edited by
      #2

      Pssst....wrong forum! Try the C# one :)

      "Benjamin is nobody's friend. If Benjamin were an ice cream flavor, he'd be pralines and dick." ~ Garth Algar "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

      1 Reply Last reply
      0
      • J Jaasiel

        Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

        H Offline
        H Offline
        Hiren solanki
        wrote on last edited by
        #3

        Yes, I can helm this by suggesting you to put your question on THIS[^] forum. People are so bad towards kind of question here. and will constantly remind you to look at the top of the page.

        Regards, Hiren.

        1 Reply Last reply
        0
        • J Jaasiel

          Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

          N Offline
          N Offline
          Nagy Vilmos
          wrote on last edited by
          #4

          --- DO NOT ASK PROGRAMMING QUESTIONS IN THE LOUNGE --- I'd quickly apologise and move this to Q&A if I was you.


          Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

          H A 2 Replies Last reply
          0
          • N Nagy Vilmos

            --- DO NOT ASK PROGRAMMING QUESTIONS IN THE LOUNGE --- I'd quickly apologise and move this to Q&A if I was you.


            Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

            H Offline
            H Offline
            Hiren solanki
            wrote on last edited by
            #5

            Nagy Vilmos wrote:

            I'd quickly apologise and move this to Q&A if I was you.

            As a newbie, It seems it will be too late till the time he realizes.

            Regards, Hiren.

            1 Reply Last reply
            0
            • N Nagy Vilmos

              --- DO NOT ASK PROGRAMMING QUESTIONS IN THE LOUNGE --- I'd quickly apologise and move this to Q&A if I was you.


              Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

              A Offline
              A Offline
              Andrei Straut
              wrote on last edited by
              #6

              Nagy Vilmos wrote:

              I'd quickly apologise and move this to Q&A if I was you.

              Can we start the Univote Frenzy now, pleeez pleeeeez pleeeeeeeez? [Edit]: Posted this before it was moved to C# forum [/Edit]

              Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

              1 Reply Last reply
              0
              • J Jaasiel

                Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

                E Offline
                E Offline
                Ed Hill _5_
                wrote on last edited by
                #7

                I'm not overly familiar with winforms and the correct way to filter data on a datagrid view. But something like the following may help you.

                var filteredItems = Items.Where(row=>textbox1.Lines.Contains(row.FilterColumn));

                you may want to do something more to allow for ignoring the case of what you are filtering on, but filteredItems should be a step towards what you want.

                1 Reply Last reply
                0
                • J Jaasiel

                  Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  With what exactly? Where will the filtering take place, on the server or on the client-machine? And how do your lines in the textbox match up with the tablenames? Perhaps if you showed us some code that explains how you load the data in there, we might hint what the most appropriate solution could be.

                  Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

                  1 Reply Last reply
                  0
                  • J Jaasiel

                    Hi, im a have a multiline texbox and a datagridview all c#. I want to filter the grid by the multiline textbox and need to use every single line to filter the grid. Please can somebody helm me with that?? Jaasiel

                    B Offline
                    B Offline
                    BillWoodruff
                    wrote on last edited by
                    #9

                    Let's assume your DataGridView is already full of Data, in Cells, organized in Rows and Columns, naturally. Now for each line of text in the multi-line TextBox: Exactly how do you want to use that to filter either certain Cells, or certain Rows, or certain Columns, in your DataGridView ? What exactly does "filter" mean here: to hide something that does not "match," or ... ? What have you tried so far ? I do think if you can write up your problem more clearly, that it would be better, for you, if you posted it in the QA section. best, Bill

                    "Everything we call real is made of things that cannot be regarded as real." Niels Bohr

                    J 1 Reply Last reply
                    0
                    • B BillWoodruff

                      Let's assume your DataGridView is already full of Data, in Cells, organized in Rows and Columns, naturally. Now for each line of text in the multi-line TextBox: Exactly how do you want to use that to filter either certain Cells, or certain Rows, or certain Columns, in your DataGridView ? What exactly does "filter" mean here: to hide something that does not "match," or ... ? What have you tried so far ? I do think if you can write up your problem more clearly, that it would be better, for you, if you posted it in the QA section. best, Bill

                      "Everything we call real is made of things that cannot be regarded as real." Niels Bohr

                      J Offline
                      J Offline
                      Jaasiel
                      wrote on last edited by
                      #10

                      Thanks everybody for helping! And sorry for late answer. Bill , as you're saying i have a datagridview full of data. What I want is show the datagridview rows that match with the lines in the multiline textbox For example: my datagridview have two columns: Name and Last Name to say something... In the textbox I type in the first line John and in the second line I type Mary. I want the datagrid to show me only the rows that have these names. And if I keep typing in others lines keep doing the firter or search... I hope I explained better now... Thanks in advance!

                      B 1 Reply Last reply
                      0
                      • J Jaasiel

                        Thanks everybody for helping! And sorry for late answer. Bill , as you're saying i have a datagridview full of data. What I want is show the datagridview rows that match with the lines in the multiline textbox For example: my datagridview have two columns: Name and Last Name to say something... In the textbox I type in the first line John and in the second line I type Mary. I want the datagrid to show me only the rows that have these names. And if I keep typing in others lines keep doing the firter or search... I hope I explained better now... Thanks in advance!

                        B Offline
                        B Offline
                        BillWoodruff
                        wrote on last edited by
                        #11

                        If you will re-post this in QA, with the details you've disclosed: I will respond in greater depth, and I think you'll get many other helpful comments from other people. best, Bill

                        "Everything we call real is made of things that cannot be regarded as real." Niels Bohr

                        J 1 Reply Last reply
                        0
                        • B BillWoodruff

                          If you will re-post this in QA, with the details you've disclosed: I will respond in greater depth, and I think you'll get many other helpful comments from other people. best, Bill

                          "Everything we call real is made of things that cannot be regarded as real." Niels Bohr

                          J Offline
                          J Offline
                          Jaasiel
                          wrote on last edited by
                          #12

                          Ok. Sorry im newbi in the foro, can you plese guide me how to do the post in QA. Thanks in advance!

                          B 1 Reply Last reply
                          0
                          • J Jaasiel

                            Ok. Sorry im newbi in the foro, can you plese guide me how to do the post in QA. Thanks in advance!

                            B Offline
                            B Offline
                            BillWoodruff
                            wrote on last edited by
                            #13

                            From CP's Main Menu: mouse over "Quick Answers:" select "Ask a Question" from the drop-down menu. best, Bill

                            "Everything we call real is made of things that cannot be regarded as real." Niels Bohr

                            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