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. HTML Table Cell value

HTML Table Cell value

Scheduled Pinned Locked Moved ASP.NET
html
5 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.
  • G Offline
    G Offline
    Girish481
    wrote on last edited by
    #1

    Hello, I have placed a html table control on my web page. I wish to fill the rows and columns with dataset's rows and column. Please tell me the easy the faster way to fill the html table with dataset. Dataset is carrying 20 rows and 8 columns. Thanks & Regards Girish Sharma

    L S 2 Replies Last reply
    0
    • G Girish481

      Hello, I have placed a html table control on my web page. I wish to fill the rows and columns with dataset's rows and column. Please tell me the easy the faster way to fill the html table with dataset. Dataset is carrying 20 rows and 8 columns. Thanks & Regards Girish Sharma

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The easiest way is go for a GridView control in asp.net 2.0. You can display the dataset content in a tabular format by writing few lines of code. It will also maintain the ViewState between postback. You can also provide the sorting, paging and filter options.

      G 1 Reply Last reply
      0
      • G Girish481

        Hello, I have placed a html table control on my web page. I wish to fill the rows and columns with dataset's rows and column. Please tell me the easy the faster way to fill the html table with dataset. Dataset is carrying 20 rows and 8 columns. Thanks & Regards Girish Sharma

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

        You can't use a HTML table in the code-behind to bind it to the dataset. You need to set runat="server" attribute to true. You can also use the HTMLTextWrite class to generate the table. Otherwise, you can always use the grid view control with out writing so many lines of code. But it totally depends on the requirement.

        Either you love IT or leave IT...

        1 Reply Last reply
        0
        • L Lost User

          The easiest way is go for a GridView control in asp.net 2.0. You can display the dataset content in a tabular format by writing few lines of code. It will also maintain the ViewState between postback. You can also provide the sorting, paging and filter options.

          G Offline
          G Offline
          Girish481
          wrote on last edited by
          #4

          So, finally, i am using GridView control, but one little question more: How do i set column name as per query column; i.e. suppose select query is : select Cname as "Candidate Name" from table1. So i wish to give the column name "Candidate Name" like wise. Thanks & Regards Girish Sharma

          B 1 Reply Last reply
          0
          • G Girish481

            So, finally, i am using GridView control, but one little question more: How do i set column name as per query column; i.e. suppose select query is : select Cname as "Candidate Name" from table1. So i wish to give the column name "Candidate Name" like wise. Thanks & Regards Girish Sharma

            B Offline
            B Offline
            Baran M
            wrote on last edited by
            #5

            You can use RowDataBound event. Google it. you can do it like in that event, "If e.Row.RowType = DataControlRowType.Header Then    do somthing End If"

            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