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. Web Development
  3. ASP.NET
  4. i want to add more than 1 columns with ColumnName=" " in the C#asp.net datagrid after data is bind to it.

i want to add more than 1 columns with ColumnName=" " in the C#asp.net datagrid after data is bind to it.

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
3 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
    s_aslam98
    wrote on last edited by
    #1

    e.g. datagrid to look like after name and address columns have bind to datagrid. name l address l l l

    M 1 Reply Last reply
    0
    • S s_aslam98

      e.g. datagrid to look like after name and address columns have bind to datagrid. name l address l l l

      M Offline
      M Offline
      mr_muskurahat
      wrote on last edited by
      #2

      in such a situation you will have to hide column after binding it... but if you hide that column using grid property of hiding it then you wont be able to use that data in it or data will be lost on postback...

      umerumerumer

      S 1 Reply Last reply
      0
      • M mr_muskurahat

        in such a situation you will have to hide column after binding it... but if you hide that column using grid property of hiding it then you wont be able to use that data in it or data will be lost on postback...

        umerumerumer

        S Offline
        S Offline
        Santhosh N
        wrote on last edited by
        #3

        U can use bound field. BoundField b = new BoundField(); b.DataField = field name you would like to bind with. b.HeaderText = " "; datagrid.Columns.Add(b);

        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