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. Visual Basic
  4. DataGrid Display Question

DataGrid Display Question

Scheduled Pinned Locked Moved Visual Basic
questiondatabasewpfwcf
4 Posts 3 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
    satcomengineer
    wrote on last edited by
    #1

    I am linking all of the columns of a database table to a dataset, binding the table to a datagrid, and using simple binding to bind individual fields to text boxes. However, in the datagrid, I would like to only display a small subset of the columns in the record so that a user can recognize and select the desired record. I don't see a convenient way to do this. The DataView appears to require display of all of the table's columns. Any suggestions?

    D A 2 Replies Last reply
    0
    • S satcomengineer

      I am linking all of the columns of a database table to a dataset, binding the table to a datagrid, and using simple binding to bind individual fields to text boxes. However, in the datagrid, I would like to only display a small subset of the columns in the record so that a user can recognize and select the desired record. I don't see a convenient way to do this. The DataView appears to require display of all of the table's columns. Any suggestions?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The DEFAULT DataView will generate all columns. Create your own DataView using only the columns you want (why do you think they call it a VIEW?), then Bind the DataGrid to that. Creating a DataView[^] (.NET Developers Guide) Pay particular attention to the links at the bottom of the page. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      S 1 Reply Last reply
      0
      • S satcomengineer

        I am linking all of the columns of a database table to a dataset, binding the table to a datagrid, and using simple binding to bind individual fields to text boxes. However, in the datagrid, I would like to only display a small subset of the columns in the record so that a user can recognize and select the desired record. I don't see a convenient way to do this. The DataView appears to require display of all of the table's columns. Any suggestions?

        A Offline
        A Offline
        Avarona
        wrote on last edited by
        #3

        You should charge into dataset ONLY the lines and columns of the database table you really need, in this way it should works fine. To do it you only need to filter them using a SQL query. I mean you shouldn't charge dataset directly from database, you should charge dataset using a SQL query, in this way you'll see into Datagrid only the lines and columns you need. I hope this help you.:-D

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          The DEFAULT DataView will generate all columns. Create your own DataView using only the columns you want (why do you think they call it a VIEW?), then Bind the DataGrid to that. Creating a DataView[^] (.NET Developers Guide) Pay particular attention to the links at the bottom of the page. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          S Offline
          S Offline
          satcomengineer
          wrote on last edited by
          #4

          You were right. Thanks. It was right under my nose all the time.

          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