在DataGrid的ItemDataBound事件中:
if (bIsReadOnly1 == true) //第一列是否为ReadOnly
{
TextBox txt = (TextBox)e.Item.Cells[0].Controls[0];
txt.Visible = false;
e.Item.Cells[0].Controls.Add(new LiteralControl(txt.Text));
}try it.
if (bIsReadOnly1 == true) //第一列是否为ReadOnly
{
TextBox txt = (TextBox)e.Item.Cells[0].Controls[0];
txt.Visible = false;
e.Item.Cells[0].Controls.Add(new LiteralControl(txt.Text));
}try it.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货