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. Dynamically add table rows by selecting value from DropdownList - not working correctly

Dynamically add table rows by selecting value from DropdownList - not working correctly

Scheduled Pinned Locked Moved ASP.NET
htmltutorial
1 Posts 1 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
    samflex
    wrote on last edited by
    #1

    Greetings again dear experts. We have a working code that dynamically adds a new row to html table by clicking an Add Row button using gridview. A user can add rows or remove rows. This has worked great now for quite some time. However, we have now been tasked with using DropDownList to row the rows dynamically. For example, we have a dropdown with 5 values, 1 through 5. 1 is selected by default form the dropdown and one empty row is displayed. If a user selects two from the dropdown, 2 rows are displayed, etc. I have a code I can't get to work correctly. By that I mean, dropdown has a default value of 1 but no rows are displayed. Even worse, when you select say two from the dropdown, you get inconsistent number of rows displayed. Finally, when you click to remove rows, it removes everything, not just the row you wish to remove. I am a bit stumped. Your assistance is greatly appreciated.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="toilets.aspx.vb" Inherits="toilets" %>
    <%@ Register Src="~/UserControl.ascx" TagName="UserControl" TagPrefix="uc1" %>

    1
                                2
                                3
                                4
                                5
    
    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