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. GridView DataBind, Adds an extra row to the gridview.

GridView DataBind, Adds an extra row to the gridview.

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

    Hi all, I am trying to bind a datatable to a Gridview, In each row i add a usercontrol, The table has 8 rows, The problem is when i call the GridView.Databind() method, and extra row is added to the gridview i.e. the gridview displays 9 rows on the page. What could be the cause of this?

    Thanks & Regards, Pramod "Everyone is a genius at least once a year"

    N 1 Reply Last reply
    0
    • A AB7771

      Hi all, I am trying to bind a datatable to a Gridview, In each row i add a usercontrol, The table has 8 rows, The problem is when i call the GridView.Databind() method, and extra row is added to the gridview i.e. the gridview displays 9 rows on the page. What could be the cause of this?

      Thanks & Regards, Pramod "Everyone is a genius at least once a year"

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      AB7771 wrote:

      In each row i add a usercontrol,

      To where you are adding this? To a new column? Hard to give suggestions without seeing the code.

      Navaneeth How to use google | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        AB7771 wrote:

        In each row i add a usercontrol,

        To where you are adding this? To a new column? Hard to give suggestions without seeing the code.

        Navaneeth How to use google | Ask smart questions

        A Offline
        A Offline
        AB7771
        wrote on last edited by
        #3

        I am binding a dataset to a Gridview. Gridview1.DataSource = dtTable; GridView1.DataBind(); And in the GridView1_RowCreated() method I add the usercontrol for each row. TableCell cell = new TableCell(); e.row.cells[0].Add(LoadControl("~/Usercontrol1.ascx")); Hope that clears it.

        Thanks & Regards, Pramod "Everyone is a genius at least once a year"

        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