Skip to content
Advertisement

Connect between different row of table

I have a table with 100 or more rows that are created at runtime in asp.net by Table.

This table shows projects of a user.

Different user have some different projects.

I want when admin clicks on row of name user show rows content list of user project (slideToggle).

enter image description here


enter image description here


enter image description here

 protected void btnShowProject_Click(object sender, EventArgs e)
{
        Project project = new Project();
        DataTable result = project.getAll( );

        Table table = new Table();            
        TableRow tableRow = new TableRow();
        TableCell tableCell = new TableCell();
        
        tableCell.Text = "id";            
        tableRow.Cells.Add(tableCell);

        tableCell = new TableCell();
        tableCell.Text = "name";
        tableRow.Cells.Add(tableCell);

        table.Rows.Add(tableRow);
        tableRow = new TableRow();

        for (int i = 0; i < result.Rows.Count; i++)
        {
            for (int j = 0; j < result.Columns.Count; j++)
            {

                tableCell = new TableCell();              
                tableCell.Text = result.Rows[i][j].ToString();
                tableRow.Cells.Add(tableCell);
            }
            table.Rows.Add(tableRow);
            tableRow = new TableRow();
        }

        contentProject.Controls.Add( table);

}

Advertisement

Answer

Take look to this: http://jqueryui.com/demos/accordion/

I think this is what you want, try something from the examples. If you would have problems post back.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement