您的位置:首页 > 其它

操作GridView嵌套的Repeater控件

2011-11-04 11:05 323 查看
protected void gridView_DataBound(object sender, EventArgs e)

{

int index = gv.EditIndex;

Repeater rpt = (Repeater)gv.Rows[index].Cells[2].FindControl("rpt");

RepeaterItemCollection cc = rpt.Items;

for (i = 0; i < cc.Count; i++)

{

for (int j = 0; j < cc[i].Controls.Count;j++)

{

HyperLink list = cc[i].Controls[j] as HyperLink;

if (list != null)

{

list.Visible = false;

}

else

{

TextBox lb = cc[i].Controls[j] as TextBox;

if (lb != null)

{

lb.Visible = true;

}

}

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: