Code .NET SQL
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment :
Cartes Pokémon EV6.5 : où trouver le ...
Voir le deal

GridView RowDataBound

Aller en bas

GridView RowDataBound Empty GridView RowDataBound

Message  Admin Mar 25 Sep - 10:17

Code:
public void GridViewAllPartResults_OnRowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string format;
            if (displayVariant)
                format = FORMATPERCENT;
            else
                format = FORMATNUMBER;

            // Display the formated number.
            foreach (TableCell tableCell in e.Row.Cells)
            {
                string columnName = ((System.Web.UI.WebControls.DataControlFieldCell)(tableCell)).ContainingField.ToString();
                if (columnName != TITLE)
                {
                    if (tableCell.Text != " ")
                    {

                        double formatValue = Convert.ToDouble(tableCell.Text);

                        tableCell.Text = formatValue.ToString(format);
                    }
                }

            }

        }


    }

Admin
Admin

Messages : 91
Date d'inscription : 20/09/2007

https://moaner101.forumpro.fr

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser