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. search items inside datagridview

search items inside datagridview

Scheduled Pinned Locked Moved C#
algorithmshelp
5 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.
  • Z Offline
    Z Offline
    zafax_
    wrote on last edited by
    #1

    hi i need help in searching records in datagridview and was trying this for days still i couldn't do it... here is the details in a datagridview1 i have the following columns. Code | Description | Price | Qty | Total when user types a code number in the code Column...... description and price is automatically displayed, thanks cheers zafax

    so much of happy ending...

    C 1 Reply Last reply
    0
    • Z zafax_

      hi i need help in searching records in datagridview and was trying this for days still i couldn't do it... here is the details in a datagridview1 i have the following columns. Code | Description | Price | Qty | Total when user types a code number in the code Column...... description and price is automatically displayed, thanks cheers zafax

      so much of happy ending...

      C Offline
      C Offline
      clfalh
      wrote on last edited by
      #2

      types a code ->select the database/dataset/datatable(This depends on your needs) to search you need->bind datagridview again.If you do not wish to refresh,you can use ajax.dll. i am chinese,english is not my first language.so i can't speak in detail.Hope I express clearly

      Z 1 Reply Last reply
      0
      • C clfalh

        types a code ->select the database/dataset/datatable(This depends on your needs) to search you need->bind datagridview again.If you do not wish to refresh,you can use ajax.dll. i am chinese,english is not my first language.so i can't speak in detail.Hope I express clearly

        Z Offline
        Z Offline
        zafax_
        wrote on last edited by
        #3

        thanks for your reply. are you sure u did understand my message ? it could be grateful if you could help me in code style, im creating a windows application.

        so much of happy ending...

        C 1 Reply Last reply
        0
        • Z zafax_

          thanks for your reply. are you sure u did understand my message ? it could be grateful if you could help me in code style, im creating a windows application.

          so much of happy ending...

          C Offline
          C Offline
          clfalh
          wrote on last edited by
          #4

          when user types a code number in the code Column...... description and price is automatically displayed let me see.yes ,i do not understand the message . Two kinds of situations 1: add a new textbox to input the code ,when the textbox change,the information display in the datagridview.of course,you said you want search the datagridview,so the datagridview is be filled at firt.datagridview's datasource usuall is datatable . you can write the code like this

              DataTable dt = ds.Table\[0\];
              DataView dv = dt.DefaultView;
              dv.RowFilter = "ID = '"+textBox1.Text+"'";   //
               dataGridView1.DataSource = dv;
          

          2:I am a real jerk.I don't understand what you mean.If this is true.i am very sorry,but you could laugh whit me at my poor english.

          Z 1 Reply Last reply
          0
          • C clfalh

            when user types a code number in the code Column...... description and price is automatically displayed let me see.yes ,i do not understand the message . Two kinds of situations 1: add a new textbox to input the code ,when the textbox change,the information display in the datagridview.of course,you said you want search the datagridview,so the datagridview is be filled at firt.datagridview's datasource usuall is datatable . you can write the code like this

                DataTable dt = ds.Table\[0\];
                DataView dv = dt.DefaultView;
                dv.RowFilter = "ID = '"+textBox1.Text+"'";   //
                 dataGridView1.DataSource = dv;
            

            2:I am a real jerk.I don't understand what you mean.If this is true.i am very sorry,but you could laugh whit me at my poor english.

            Z Offline
            Z Offline
            zafax_
            wrote on last edited by
            #5

            hi bro. you really got my point and you did exactly what i asked for . thanks. But just one thing i needed is that i dont want a textbox. instead i want search data by using datagridview column which is the first column. thanks ...................:)

            so much of happy ending...

            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