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. Display Data in GridView Asp.Net 2.0

Display Data in GridView Asp.Net 2.0

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netwpfwcf
6 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.
  • J Offline
    J Offline
    Jay_se
    wrote on last edited by
    #1

    Hi, I am Binding a DataTable with a GridView control. This DataTable contains four DataColumn values (all are string type). So, in my GridView each row is displayed as FOUR columns.(ie)One Column for each DataColumn. But i wish to display all the FOUR DataColumn values in a Single Column (Cell) of a Data Row in the GridView. In this, i need to bind all the Four DataColumn values in a Single Cell's four server controls (like Label control,etc.) How can i achieve this?

    Regards, Jay

    I 1 Reply Last reply
    0
    • J Jay_se

      Hi, I am Binding a DataTable with a GridView control. This DataTable contains four DataColumn values (all are string type). So, in my GridView each row is displayed as FOUR columns.(ie)One Column for each DataColumn. But i wish to display all the FOUR DataColumn values in a Single Column (Cell) of a Data Row in the GridView. In this, i need to bind all the Four DataColumn values in a Single Cell's four server controls (like Label control,etc.) How can i achieve this?

      Regards, Jay

      I Offline
      I Offline
      immori
      wrote on last edited by
      #2

      just do that < asp:GridView ID="gv" runat="server"> < Columns> < asp:TemplateField> <%#DataBinder.Eval(Container,"DataItem.YourFirstColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourSecondColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourThirdColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourForthColumnName") %> < /asp:TemplateField> < /Columns> < /asp:GridView>

      J 1 Reply Last reply
      0
      • I immori

        just do that < asp:GridView ID="gv" runat="server"> < Columns> < asp:TemplateField> <%#DataBinder.Eval(Container,"DataItem.YourFirstColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourSecondColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourThirdColumnName") %> <%#DataBinder.Eval(Container,"DataItem.YourForthColumnName") %> < /asp:TemplateField> < /Columns> < /asp:GridView>

        J Offline
        J Offline
        Jay_se
        wrote on last edited by
        #3

        It works fine with me. But my Requirement is that, i wish to Convert each three rows of GridView data into Single row. ie the DataRow in the GridView control is supposed to Display within a Single Cell of GridView. (ie)Each Three row's Datas are need to Display in a Single Row with Three Columns. In this, every column in the GridView having the Same set of Server controls to Display the data from DataTable. Have u understand my requrement? Thank u a lot...

        Regards, Jay

        T 1 Reply Last reply
        0
        • J Jay_se

          It works fine with me. But my Requirement is that, i wish to Convert each three rows of GridView data into Single row. ie the DataRow in the GridView control is supposed to Display within a Single Cell of GridView. (ie)Each Three row's Datas are need to Display in a Single Row with Three Columns. In this, every column in the GridView having the Same set of Server controls to Display the data from DataTable. Have u understand my requrement? Thank u a lot...

          Regards, Jay

          T Offline
          T Offline
          ToddHileHoffer
          wrote on last edited by
          #4

          Check here. http://www.codeproject.com/script/comments/forums.asp?forumid=12076&mode=all&userid=2667963&select=1648604&df=100&fr=88.5&msg=1648604


          how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

          J 2 Replies Last reply
          0
          • T ToddHileHoffer

            Check here. http://www.codeproject.com/script/comments/forums.asp?forumid=12076&mode=all&userid=2667963&select=1648604&df=100&fr=88.5&msg=1648604


            how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

            J Offline
            J Offline
            Jay_se
            wrote on last edited by
            #5

            Hi Todd, For me, Item property of the DataRowView 'drv' doesnot exist. I dont know the reason, why it is not show me? ( ie drv.Item) Hence i am not familiar using DataRowView Class, now i am in learning process. I ll get back to you soon. Thanks for your interest with me.

            Regards, Jay

            1 Reply Last reply
            0
            • T ToddHileHoffer

              Check here. http://www.codeproject.com/script/comments/forums.asp?forumid=12076&mode=all&userid=2667963&select=1648604&df=100&fr=88.5&msg=1648604


              how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

              J Offline
              J Offline
              Jay_se
              wrote on last edited by
              #6

              Thanks ToddHileHoffer for ur guidance. I have got it.:)

              Regards, Jay

              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