谁能帮我解释一段代码,说者有分
string cj;
if (e.Row.RowType == DataControlRowType.DataRow)
{
if ((e.Row.RowState & DataControlRowState.Edit) != 0)
{
cj = ((TextBox)e.Row.FindControl( "tfen ")).Text.Trim();
cj = cj.Replace( ".00 ", " ");
if (e.Row.Cells[0].Text.IndexOf( "米 ") > -1)
{
((TextBox)e.Row.FindControl( "tfen ")).Text = cj.Trim().Substring(0, cj.Trim().Length - 4);
((TextBox)e.Row.FindControl( "tmiao ")).Text = cj.Trim().Substring(cj.Trim().Length - 4, 2);
((TextBox)e.Row.FindControl( "tw ")).Text = cj.Trim().Substring(cj.Trim().Length - 2, 2);
}
else
{
((Label)e.Row.FindControl( "lfen ")).Text = "米 ";
((TextBox)e.Row.FindControl( "tmiao ")).Visible = false;
((Label)e.Row.FindControl( "lmiao ")).Visible = false;
((TextBox)e.Row.FindControl( "tw ")).Visible = false;
}
}
&