Jump to content

[Resolvido] - Alterar a cor da linha de uma GridView dinamicamente...


LCarreira
 Share

Recommended Posts

Já resolvi...

De qualquer forma obrigado pela disponibilidade...

protected void GridPresencForm_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (DataBinder.Eval(e.Row.DataItem, "Status").ToString() == "0")
                {
                    e.Row.BackColor = System.Drawing.Color.Red;
                }
            }
        }
        catch (Exception erro)
        {
            // Display error message
            dbMessageLabel.ForeColor = Color.Red;
            dbMessageLabel.Text = "Erro na Grid... " + erro.Message;
        }
    }
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.