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. How to dynamically bind ItemTempalate in dynamically.

How to dynamically bind ItemTempalate in dynamically.

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasesql-serverwpf
4 Posts 4 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.
  • I Offline
    I Offline
    imranafsari
    wrote on last edited by
    #1

    Dear all, I am using asp.net, C# , Sql Server 2005. I am using datalist control and bind it like<%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid1") %>
    <%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid2") %> Here I am binding category and image path field. Now these are static field I would like to know whether Is it possible to dynamically bind these field. That mean based on dataset filed can I be able to bind all the filed irrespective of its field defined Thanks

    imran khan

    C J C 3 Replies Last reply
    0
    • I imranafsari

      Dear all, I am using asp.net, C# , Sql Server 2005. I am using datalist control and bind it like<%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid1") %>
      <%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid2") %> Here I am binding category and image path field. Now these are static field I would like to know whether Is it possible to dynamically bind these field. That mean based on dataset filed can I be able to bind all the filed irrespective of its field defined Thanks

      imran khan

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

      Do you mean to dynamically find the fields and show whatever is there ? The GridView at least has an AutoPopulate property that will just show whatever is in the data source.

      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 )

      1 Reply Last reply
      0
      • I imranafsari

        Dear all, I am using asp.net, C# , Sql Server 2005. I am using datalist control and bind it like<%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid1") %>
        <%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid2") %> Here I am binding category and image path field. Now these are static field I would like to know whether Is it possible to dynamically bind these field. That mean based on dataset filed can I be able to bind all the filed irrespective of its field defined Thanks

        imran khan

        J Offline
        J Offline
        John ph
        wrote on last edited by
        #3

        when you bind the dataset to the datalist control, ItemDataBound Event of the datalist control fires for each item in the datalist. In the Event you can find the control and assign the data item value to the control.


        Regards
        John


        1 Reply Last reply
        0
        • I imranafsari

          Dear all, I am using asp.net, C# , Sql Server 2005. I am using datalist control and bind it like<%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid1") %>
          <%# "Category : " + DataBinder.Eval(Container.DataItem,"Categoryid2") %> Here I am binding category and image path field. Now these are static field I would like to know whether Is it possible to dynamically bind these field. That mean based on dataset filed can I be able to bind all the filed irrespective of its field defined Thanks

          imran khan

          C Offline
          C Offline
          ChrisKo 0
          wrote on last edited by
          #4

          Other than the GridView that Christian has already recommended, I would also take a look at the Repeater Control[^]. It will repeat whatever HTML layout you want to use for each item in a list.

          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