füge boundField zu gridview in der Codebehind-Datei C # hinzu
Ich möchte ein neues Gridview in der Codebehind-Datei asp.net C # erstellen. Genau so ein Boundfield möchte ich der Gridview per C # -Code hinzufügen:
<asp:BoundField DataField="p_type" HeaderText="type" ItemStyle-Width="70px">
<ItemStyle Width="70px"></ItemStyle>
</asp:BoundField>
Ich habe ein neues Gridview mit folgendem Code erstellt:
GridView GridView1 = new GridView();
GridView1.AllowPaging = false;
GridView1.CellPadding = 4;
GridView1.GridLines= GridLines.None;
GridView1.AutoGenerateColumns = false;
Und ich möchte diesem Gridview ein neues boundField hinzufügen. Wie mache ich das mit C # -Code?