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