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. populating datagrid based on a query output

populating datagrid based on a query output

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasehelp
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.
  • U Offline
    U Offline
    User 832313
    wrote on last edited by
    #1

    Hi guys, I'm using a form in vb.net that has few textboxes and a combobox and a datagrid... my problem is based on a selected combobox value (which is actually an order number) I need to populate the datagrid with selected rows and columns that satisfy the query criteria... (say only those rows that has the same order number as selected in the combobox... and also say 4 column out of 10) I'm not sure how u can do this ... Any clue any suggestion is welcomed... thanks

    S 1 Reply Last reply
    0
    • U User 832313

      Hi guys, I'm using a form in vb.net that has few textboxes and a combobox and a datagrid... my problem is based on a selected combobox value (which is actually an order number) I need to populate the datagrid with selected rows and columns that satisfy the query criteria... (say only those rows that has the same order number as selected in the combobox... and also say 4 column out of 10) I'm not sure how u can do this ... Any clue any suggestion is welcomed... thanks

      S Offline
      S Offline
      Syed Abdul Khader
      wrote on last edited by
      #2

      You can set the RowFilter of the Datagrid in the ComboBox SelectedIndexChanged event. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged 'ur selected order no m_orderNo = Integer.Parse(CType(ComboBox1.SelectedValue, String) CType(DataGrid1.DataSource, DataTable).DefaultView.RowFilter = "orderno = " + m_orderNo.ToString() End Sub

      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