来自网上
Code
private void ChangTextCouldEdit()
{
foreach (DataGridItem dgi in DataGrid1.Items)
{
TextBox txtMaterialID = (TextBox)dgi.FindControl("txtMaterialID");
TextBox txtTaxedUnitPrice = (TextBox)dgi.FindControl("lblTaxedUnitPrice");
TextBox txtTax = (TextBox)dgi.FindControl("lblTax");
HtmlInputHidden hdnMaterialClassID = (HtmlInputHidden)dgi.FindControl("hdnMaterialClassId");
if (txtMaterialID.Text.Trim() != "" && hdnMaterialClassID.Value == 2)
{
txtTaxedUnitPrice.Attributes["ContentEditable"] = "true";
txtTaxedUnitPrice.Attributes["style"] = "width: 100px;";
txtTaxedUnitPrice.Attributes["class"] = "input2";
}
else
{
txtTaxedUnitPrice.Attributes["ContentEditable"] = "false";
txtTaxedUnitPrice.Attributes["style"] = "background-color: Transparent; text-align: right; border-style: none;width: 100px;";
txtTaxedUnitPrice.Attributes["className"] = "";
}
}
}
posted @
2009-11-17 11:27
wj-conquer
阅读(
600)
评论()
编辑
收藏
举报