views:

2730

answers:

2

Is it possible to add a row to a gridview at runtime? I need to add a default row(sometimes) and then add an adhoc row after the bound row based on a value in the bound row.

gridView.DataSource = source;
/// Create a new Default Row here
gridview.DataBind();

AND

OnDataBound(object sender, DataGridEventArgs e)
//evaluate each row and if certain criteria add a new row.
+2  A: 

This might solve your problem.

Sachin Gaur
+1  A: 

It would be easier to determine if you need to add additional rows before databinding.

leppie