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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Addin Table in panel at runtime

Addin Table in panel at runtime

Scheduled Pinned Locked Moved ASP.NET
3 Posts 2 Posters 2 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.
  • F Offline
    F Offline
    Fahim A Salim
    wrote on last edited by
    #1

    I add certain controls to table than i add the table to panel every time user preses add conrtrol than i write some text in the controls added and press submit but when i try to acess the table from the panel. the panel has no table

    A 1 Reply Last reply
    0
    • F Fahim A Salim

      I add certain controls to table than i add the table to panel every time user preses add conrtrol than i write some text in the controls added and press submit but when i try to acess the table from the panel. the panel has no table

      A Offline
      A Offline
      Abolfazl Sheikhloo
      wrote on last edited by
      #2

      u must override OnInit Event and place codes in this section or send me, your codes for check it and reply to u.

      We Can Do Anything, If We Want It

      F 1 Reply Last reply
      0
      • A Abolfazl Sheikhloo

        u must override OnInit Event and place codes in this section or send me, your codes for check it and reply to u.

        We Can Do Anything, If We Want It

        F Offline
        F Offline
        Fahim A Salim
        wrote on last edited by
        #3

        using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { //System.Collections.ArrayList ar = new System.Collections.ArrayList(); Table table = new Table(); Table outtable = new Table(); //Table table; // Table outtable; protected void Page_Load(object sender, EventArgs e) { //if ((Session["isaddclicked"] != null) && ((bool)Session["isaddclicked"])) //{ // if (Session["controlsArray"] != null) //{ // // ar = (System.Collections.ArrayList)Session["controlsArray"]; // table = (Table)Session["controlsArray"]; // } //pnContralPanel.Controls.Add(table); //pnoutputpanel.Controls.AddAt(0,outtable); // } //for (int i = 0; i < ar.Count; i=i+2) //{ // //co (Control)ar[i]; // pnContralPanel.Controls.Add((Control)ar[i]); // pnContralPanel.Controls.Add((Control)ar[i + 1]); //} //pnContralPanel.Controls.Add(table); } protected void btnAdd_Click(object sender, EventArgs e) { Control tdddddd=pnContralPanel.Controls[0]; if (Session["controlsArray"] != null) { table = (Table)Session["controlsArray"]; //pnContralPanel = (Panel)Session["controlsArray"]; } //Session["isaddclicked"] = true; String controltoadd = ddControlList.SelectedItem.Text; Control obj = null; Label lbl= new Label(); lbl.Text = txtCaption.Text; if (controltoadd == "Text Box") { TextBox tb= new TextBox(); //tb.ID="txt"+txtCaption.Text; tb.Text=txtValues.Text; obj = tb; } else if (controltoadd == "Drop Down") { DropDownList dd = new DropDownList(); //dd.ID = "dd" + txtCaption.Text; char[] ch={','}; String[] sepstring = txtValues.Text.Split(ch); for (int i = 0; i < sepstring.Length; i++) { dd.Items.Add(sepstring[i]); } obj=dd; } else if (controltoadd == "Check Box") { CheckB

        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