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. data binding

data binding

Scheduled Pinned Locked Moved C#
csswpfwcftutorialquestion
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.
  • M Offline
    M Offline
    muharrem
    wrote on last edited by
    #1

    I am binding a datatableof a dataset to a gridview. But I want to exclude some columns from binding. How? string strSQL = string.Format("SELECT A,B,C,..); MySqlDataAdapter da = new MySqlDataAdapter(strSQL,myCommand); DataSet ds = new DataSet(); da.Fill(ds,"MyTable"); myGridView.DataSource = ds.Tables["MyTable"]; Above line, how to exclude some columns from binding to grid? Thanks

    A 1 Reply Last reply
    0
    • M muharrem

      I am binding a datatableof a dataset to a gridview. But I want to exclude some columns from binding. How? string strSQL = string.Format("SELECT A,B,C,..); MySqlDataAdapter da = new MySqlDataAdapter(strSQL,myCommand); DataSet ds = new DataSet(); da.Fill(ds,"MyTable"); myGridView.DataSource = ds.Tables["MyTable"]; Above line, how to exclude some columns from binding to grid? Thanks

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      You need to create and bind individual columns. Alternativley, in the design view you can specifiy columns and their corresponding datasource. An easier way would be to only select the columns you need. A final alternative, for those columns you do not want to see, set the width to zero.

      Bob Ashfield Consultants Ltd

      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