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
C

Chip Long

@Chip Long
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • My dynamic table will not display...
    C Chip Long

    I finally figured this out. I wasn't approaching the problem correctly. I had to change my ASP code to be an ASP:Placeholder:

    Then at the end of my code, instead of assigning the new table to the existing table (which is now gone), I replaced the placeholder control with the new table:

    tblBrowserOSTable.Controls.Clear();
    tblBrowserOSTable.Controls.Add(newTable);

    C# csharp c++ question

  • My dynamic table will not display...
    C Chip Long

    I don't see any difference between the EnableViewState being set to "true" or "false". From reading the MSDN site, I think this needs to be "false" to update the view dynamically.

    C# csharp c++ question

  • My dynamic table will not display...
    C Chip Long

    I have a table that is being dynamically generated based on selected fields from my form. However, after I have modified the table, I can't get it to display on the web page. What am I doing wrong or what else do I need to do to get the page to display correctly? ASP place holder:

    (I have tried EnableViewState="false" too.) C# code:

    protected void MakeBrowserOSTable(DataTable dtContents)
    {
    int numRows = dtContents.Rows.Count;
    int numCells = dtContents.Columns.Count;

    Table newTable = new Table(); // The table can totally change depending on the
                                  // selection - so I want to rebuild it each time.
    
    if ((numCells <= 0) || (numRows <= 0))
    {
        TableRow row = new TableRow();
        TableCell cell = new TableCell();
        cell.Controls.Add(new LiteralControl("Please choose a platform"));
        row.Cells.Add(cell);
        newTable.Rows.Add(row);
    }
    else
    {
        foreach (DataRow r in dtContents.Rows)
        {
            TableRow row = new TableRow();
    
            for (int c = 0; c < numCells; c++)
            {
                TableCell cell = new TableCell();
    
                if (c == 0)
                {
                    Label lbl = new Label();
                    lbl.Text = (string)r\[c\];
                    lbl.Text = lbl.Text.Trim();
                    cell.Controls.Add(lbl);
                }
                else
                {
                    //add other controls here
                }
                row.Cells.Add(cell);
            }
            newTable.Rows.Add(row);
        }
    }
    tblBrowserOSTable = newTable;
    

    }

    C# csharp c++ question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups