如何在c#中的转发器控件中绑定背景颜色

时间:2017-05-14 09:24:28

标签: c# asp.net repeater

我点击删除按钮的行突出显示颜色,但回发后其他行的颜色显示。

protected void rptLine_ItemCommand(object source, RepeaterCommandEventArgs e)
{
    if (newRow != null) 
    {

        if (auditLine.Is_HCPCS_CPT_Deleted == true)
        {
            newRow.BgColor = "#FFFFFF";
            auditLine.Is_HCPCS_CPT_Deleted = false;
        }
        else
        {
            if (ddlDocument.SelectedIndex == 0 || 
                ddlReason.SelectedIndex == 0)
            {
                ScriptManager.RegisterStartupScript(this, 
                    this.GetType(), "error", 
                    "alert('Document and Reason are mandatory for primary Diagnosis code.');", true);
            }
            else
            {
                auditLine.Is_HCPCS_CPT_Deleted = true;
                newRow.BgColor = "#FF7256";
            }
        }
    }
}

0 个答案:

没有答案