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. Template Columns in a DataGrid

Template Columns in a DataGrid

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
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.
  • D Offline
    D Offline
    deanoA
    wrote on last edited by
    #1

    Hi! I have a datagrid with two template columns. And I have 2 Arraylists. Can anybody please show me how to bind my 2 arraylists to their corresponding column? Please help me. :( NAME | ADDRESS A | AA B | BB C | CC D | DD Above is what I want it to look like. I A,B,C,D comes from the first arraylist and AA,BB,CC,DD comes from the second arraylist. Column NAME and column ADDRESS are template columns. Please help me. :( "To teach is to learn twice"

    M 1 Reply Last reply
    0
    • D deanoA

      Hi! I have a datagrid with two template columns. And I have 2 Arraylists. Can anybody please show me how to bind my 2 arraylists to their corresponding column? Please help me. :( NAME | ADDRESS A | AA B | BB C | CC D | DD Above is what I want it to look like. I A,B,C,D comes from the first arraylist and AA,BB,CC,DD comes from the second arraylist. Column NAME and column ADDRESS are template columns. Please help me. :( "To teach is to learn twice"

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      You'll have to manually convert the ArrayLists into a DataTable with two columns and however many rows you need, copying over the data from each array into the DataTable. Then use dg.DataSource=yourDataTable; and dg.DataBind() where "dg" is your DataGrid. I don't think it matters much if the columns are templates or not. Marc Latest AAL Article My blog Join my forum!

      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