首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

|M|请幕白兄解释一下刚才的一些代码 多谢

2011-12-19 
|M|请幕白兄解释一下刚才的一些代码 谢谢intiIndexConvert.ToInt32(e.CommandArgument)这里面的e.comman

|M|请幕白兄解释一下刚才的一些代码 谢谢
int   iIndex   =   Convert.ToInt32(e.CommandArgument);
这里面的e.commandargument取得的是什么值在前台中的     <asp:ButtonField   ButtonType= "Button "   Text= "详细 "   CommandName= "detail "   /> 并没有commandargument值啊
我点击这里他的值是当前的行index那这个是不是这个意思

                        GridViewRow   row   =   this.GridView1.Rows[iIndex];
                        GridViewRow   NewRow   =   new   GridViewRow(iIndex   +   1,   iIndex,   DataControlRowType.DataRow,   DataControlRowState.Normal);  
//这一行的中(iIndex   +   1,   iIndex,   DataControlRowType.DataRow,   DataControlRowState.Normal);  
其中DataControlRowType.DataRow,   DataControlRowState.Normal指的是新行为什么类型和状态,不明白的是前面的iIndex   +   1,   iIndex,

                        NewRow.Cells.Add(new   TableCell());
//为什么这里还要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);

[解决办法]
commandargument 其实就是当前行号.
[解决办法]
慕白老兄==牛人
[解决办法]
嵌套的GridView+js很简单

热点排行