|
int iIndex = Convert.ToInt32 (e.CommandArgument);
What value does e.commandargument get in the foreground? <Asp: ButtonField ButtonType = "Button" Text = "detail" CommandName = "detail" /> does not have a commandargument value.
I click here. Its value is the current row index. Does this mean?
GridViewRow row = this.GridView1.Rows [iIndex];
GridViewRow NewRow = new GridViewRow (iIndex + 1, iIndex, DataControlRowType.DataRow, DataControlRowState.Normal);
// In this line (iIndex + 1, iIndex, DataControlRowType.DataRow, DataControlRowState.Normal);
DataControlRowType.DataRow, DataControlRowState.Normal refers to the type and state of the new behavior. What I don't understand is the previous iIndex + 1, iIndex,
NewRow.Cells.Add (new TableCell ());
// Why should NewRow.Cells.Add (new TableCell ());
NewRow.Cells [0] .ColumnSpan = row.Cells.Count;
...
this.GridView1.Controls [0] .Controls.AddAt (iIndex + 2, NewRow);
NewRow.Cells [0] .Controls.Add (this.rp1); |
|