Vitajte na [www.pocitac.win] Pripojiť k domovskej stránke Obľúbené stránky
Kliknite na tlačidlo " Štart " na ploche a vyberte možnosť " Visual Studio " z menu " Všetky programy " .
2
Kliknite na " Otvoriť " v . menu " Súbor " a vyberte program C , ktorý chcete zobraziť viac stĺpcov v GridView konaní
3
Pridajte nasledujúci kód po " DataControlFieldCollection " riadku :
protected void grdItems_DataBound ( object sender , EventArgs e ) klipart
{
GridViewRow GRD = ( GridViewRow ) odosielateľa ;
if ( grd.RowType == DataControlRowType.Header )
{
GridViewRow riadok = new GridViewRow ( 0 , 0 , DataControlRowType.Header , DataControlRowState.Normal ) ;
TableCell cell = new TableCell ( ) ;
cell.ColumnSpan = 1 ;
cell.HorizontalAlign = HorizontalAlign.Center ;
cell.Text = " Množstvo " ;
row.Cells.Add ( bunka ) ;
cell = new TableCell ( ) ;
cell.ColumnSpan = 4 ;
cell.HorizontalAlign = HorizontalAlign.Center ;
cell.Text = " Opis " ;
row.Cells.Add ( bunka ) ;
cell = new TableCell ( ) ;
cell.ColumnSpan = 1 ;
cell.HorizontalAlign = HorizontalAlign.Center ;
cell.Text = " Množstvo " ;
row.Cells.Add ( bunka ) , Spojené
grdItems.Controls [ 0 ] . Controls.AddAt ( 0 , riadok ) ;
}
}
4
Kliknite na " Súbor " potom " Uložiť " umožniť zobrazovanie mnoho stĺpcov v GridView riadenie pod jedným záhlavím.