tags:

views:

117

answers:

2

I add one row to gridview dynamically, and also i want to add one more row to that and want to display all the rows ata atime.. how can i add rows to gridview dynamically..

A: 

Can you elaborate a bit more? Assuming C#, see this.

KMan
A: 

Try this if u r using asp.net n C# :

ChildTable table = GridView1.Rows[index].Parent as ChildTable;        //get that row
if (table != null)
{
    GridViewRow row = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal);
    TableCell cell = new TableCell();
    cell.ColumnSpan = GridView1.Columns.Count;
    cell.Width = Unit.Percentage(100);
    cell.Controls.Add(new LiteralControl("New Row"));
    row.Cells.Add(cell);
    table.Rows.Add(row);
}

Thanks,

Access Denied
Please edit and use the code tag to make the post more redable
kevchadders
You get a -1 for not writing english. "u", "r" and "n" are not wnglish words.
sindre j