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"] = "";

}

}

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-01-09
  • 2022-01-21
  • 2021-10-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案