I'm trying to add a column to a GridView, in ASP.NET 2.0
gridViewPoco.Columns.Add(...)
However, i cant find the right option. I'd like equivalents to the following:
<asp:BoundField>
<asp:TemplateField>
For example;
protected void Btn_AddCol_Click(object sender, EventArgs e)
{
TemplateField tf = new TemplateField();
tf.HeaderTemplate = new GridViewLabelTemplate(DataControlRowType.Header, "Col1", "Int32");
tf.ItemTemplate = new GridViewLabelTemplate(DataControlRowType.DataRow, "Col1", "Int32");
MyGridView.Columns.Add(tf);
}
TemplateField
Col1
) and type (Int32
)Int32
)Gridview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With