title: Inserting Gridview Column from code behind based on random index in asp.net
body: <p>I am trying to insert column into gridview, I have dropdown below the grid and dropdown is having 10 items now If i select random item assume that I am selecting 8 number item and add clicking add button. this item should create as new column at 8 number in grid.</p>
  
  <p>Suppose grid is not having any column when page is loading and trying to insert column using below code throwing error.</p>
  
  <p>var boundField = new TemplateField { HeaderText = "SelectedProductName"};
   grd.Columns.Insert(ddlProduct.SelectedIndex, boundField); </p>
  
  <p>As Selected index can be any random number but grd is throwing out of index error as grid does not have that position.</p>
  
  <p>Could you please help me to insert new column based on selected index from the dropdown.</p>
  
  <p>My goal to achieve to display grid columns as they are listing into the dropdown same sequence.</p>