DataControlField field = new AutoGeneratedField("ProductId"); field.HeaderText = "Product Id"; this.GridView2.Columns.Insert(1, field); this.GridView2.DataBind();
If you want add new column at '0' Index of table then use this ---------------------------------------------------------------- DataTable dt = new DataTable();//Your DT DataColumn col1 = new DataColumn("Profession", System.Type.GetType("System.String")); col1.AllowDBNull = true; col1.DefaultValue = ""; dt.Columns.Add(col1); col1.SetOrdinal(0);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)