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. Dyanmically creating templatefield Gridview c#

Dyanmically creating templatefield Gridview c#

Scheduled Pinned Locked Moved C#
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
    SharonRao
    wrote on last edited by
    #1

    Hello All, I need to create a template field in gridview with table of one column repeating as 5 columns. Any ideas and suggestions guys. Cheers, Shilpa. Something like this. ProductImage productImage productImage productImage productImage ProductName ProductName ProductName ProductName ProductName Price price price price price I have tried this in templatefield of gridview but the data is showing as one column

    ![](<%# Eval()" width="100" height="100" border="0">

    $<%# Eval("Price") %>

    <%# Eval("ProductName") %>

    protected void DisplayProducts(int cid) { DataSet ProductList = new DataSet() ; string cmd = "StoredprocedureName" + cid; ProductList = a.SelectDSQuery(cmd); GridView1.DataSource = ProductList; GridView1.DataBind(); }

    Thanks in Advance for your help. Best Regards

    S 1 Reply Last reply
    0
    • S SharonRao

      Hello All, I need to create a template field in gridview with table of one column repeating as 5 columns. Any ideas and suggestions guys. Cheers, Shilpa. Something like this. ProductImage productImage productImage productImage productImage ProductName ProductName ProductName ProductName ProductName Price price price price price I have tried this in templatefield of gridview but the data is showing as one column

      ![](<%# Eval()" width="100" height="100" border="0">

      $<%# Eval("Price") %>

      <%# Eval("ProductName") %>

      protected void DisplayProducts(int cid) { DataSet ProductList = new DataSet() ; string cmd = "StoredprocedureName" + cid; ProductList = a.SelectDSQuery(cmd); GridView1.DataSource = ProductList; GridView1.DataBind(); }

      Thanks in Advance for your help. Best Regards

      S Offline
      S Offline
      SharonRao
      wrote on last edited by
      #2

      sorry this was supposed to be table of 5 columns and 3 rows but its not shown properly ProductImage productImage productImage productImage productImage ProductName ProductName ProductName ProductName ProductName Price price price price price

      Thanks in Advance for your help. Best Regards

      S 1 Reply Last reply
      0
      • S SharonRao

        sorry this was supposed to be table of 5 columns and 3 rows but its not shown properly ProductImage productImage productImage productImage productImage ProductName ProductName ProductName ProductName ProductName Price price price price price

        Thanks in Advance for your help. Best Regards

        S Offline
        S Offline
        Seishin
        wrote on last edited by
        #3

        try writing snippet for it..

        life is study!!!

        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