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 : -39%
Pack Home Cinéma Magnat Monitor : Ampli DENON ...
Voir le deal
1190 €

Add header to gridview - Header on 2 rows

Aller en bas

Add header to gridview - Header on 2 rows Empty Add header to gridview - Header on 2 rows

Message  Admin Mar 25 Sep - 17:17

Code:
  protected void GridViewBreakDownHistory_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            //Build custom header.
            GridView oGridView = (GridView)sender;
            GridViewRow oGridViewRow = new GridViewRow(0,0, DataControlRowType.Header, DataControlRowState.Normal);
            TableCell oTableCell = new TableCell();

            //Add Site 1
            oTableCell.Text = "Site 1";
            oTableCell.ColumnSpan = 2;
            oGridViewRow.Cells.Add(oTableCell);

            //Add Site 2
            oTableCell = new TableCell();
            oTableCell.Text = "Site 2";
            oTableCell.ColumnSpan = 2;
            oGridViewRow.Cells.Add(oTableCell);

            oGridView.Controls[0].Controls.AddAt(0, oGridViewRow);
        }
    }

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