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. GridView

GridView

Scheduled Pinned Locked Moved ASP.NET
helpcss
3 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
    sunil kumar verma
    wrote on last edited by
    #1

    Hello, I have a grid view with one column and populated that with the following code, GridView1.DataSource = PropList; GridView1.DataBind(); Where PropList is a List of string . Now I have added another column in the GridView1 by the following code BoundField b; b = new BoundField(); b.HeaderText = "new1"; GridView1.Columns.Add(b); Now my problem is that if I have another list of string, How i Add that list to the new column. Please help me in this regards. Thanks sunil

    C 1 Reply Last reply
    0
    • S sunil kumar verma

      Hello, I have a grid view with one column and populated that with the following code, GridView1.DataSource = PropList; GridView1.DataBind(); Where PropList is a List of string . Now I have added another column in the GridView1 by the following code BoundField b; b = new BoundField(); b.HeaderText = "new1"; GridView1.Columns.Add(b); Now my problem is that if I have another list of string, How i Add that list to the new column. Please help me in this regards. Thanks sunil

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You cannot. You'd need a list of a struct which has two properties, as you can only bind to one source, but you can set the columns to pull data from properties of items in your list.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      S 1 Reply Last reply
      0
      • C Christian Graus

        You cannot. You'd need a list of a struct which has two properties, as you can only bind to one source, but you can set the columns to pull data from properties of items in your list.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        S Offline
        S Offline
        sunil kumar verma
        wrote on last edited by
        #3

        Hi, Can you please give me sample code for this. Thanks, sunil

        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