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 Basic
  4. need help selecting rows in a DataGridView

need help selecting rows in a DataGridView

Scheduled Pinned Locked Moved Visual Basic
help
4 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.
  • S Offline
    S Offline
    Shimmy Weitzhandler
    wrote on last edited by
    #1

    I want the DataGridView to select for methe row that contains 1234 in CustomerID column. thanks ;P

    Shimi

    H 1 Reply Last reply
    0
    • S Shimmy Weitzhandler

      I want the DataGridView to select for methe row that contains 1234 in CustomerID column. thanks ;P

      Shimi

      H Offline
      H Offline
      helelark123
      wrote on last edited by
      #2

      Can you be more specific. what is methe?

      Shay Noy

      S 1 Reply Last reply
      0
      • H helelark123

        Can you be more specific. what is methe?

        Shay Noy

        S Offline
        S Offline
        Shimmy Weitzhandler
        wrote on last edited by
        #3

        me+the I have two tables: Quotes and customers both tables contain a CustomerID column which the parent is of course the Customers table. now every quote belongs to only one customer. I create a binded detail-view form that is binded to the QuotesBindingSource. I added to my form a new DataGridView that shows the Customers table content. I want in every QuotesBindingSource.CurrentChanged (or something like) the CustomersDataGridView to select the appropriate customer's row according to the related CustomerID. if I'm not understandable enough please tell me and I will try to explain any more thank you! :laugh::laugh::laugh:

        Shimi

        S 1 Reply Last reply
        0
        • S Shimmy Weitzhandler

          me+the I have two tables: Quotes and customers both tables contain a CustomerID column which the parent is of course the Customers table. now every quote belongs to only one customer. I create a binded detail-view form that is binded to the QuotesBindingSource. I added to my form a new DataGridView that shows the Customers table content. I want in every QuotesBindingSource.CurrentChanged (or something like) the CustomersDataGridView to select the appropriate customer's row according to the related CustomerID. if I'm not understandable enough please tell me and I will try to explain any more thank you! :laugh::laugh::laugh:

          Shimi

          S Offline
          S Offline
          Shimmy Weitzhandler
          wrote on last edited by
          #4

          this worked: Private Sub ctlSpan_TextChanged(ByVal sender As Control, ByVal e As System.EventArgs) Handles ctlSpan.TextChanged With CustomersDataGridView If .Columns.Contains("CustomerID") Then For Each row As DataGridViewRow In .Rows If row.Cells("CustomerID").Value.ToString = sender.Text Then If row.Cells("CustomerID").Value IsNot Nothing Then If Not row.Selected Then row.Selected = True End If End If Next End If End With End Sub

          Shimi

          modified on Sunday, December 30, 2007 11:39:28 PM

          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