title: Data is not editable in gridview when through code
body: <p>I have a drop down list in which data is bind from a table, I have another GridV
  iew in which same data is to be filled that is present in the DropDown list. 
  The data is bind through the code in c#, but then it cannot be edited.</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!Page.IsPostBack)
      {
          var userid = (Guid)Membership.GetUser().ProviderUserKey;
          ClientAdminMultiView.SetActiveView(MasterFundsView);
          List&lt;T_W_Company&gt; allowedCompanies = Source.aspnet_AdminUserClientMapping.Where(x =&gt; x.UserID == userid).Select(p =&gt; p.T_W_Company).ToList();
          CompanyDropDown.DataSource = allowedCompanies;
          CompanyDropDown.DataBind();
          GridView1.DataSource = allowedCompanies;
          GridView1.DataBind();
      }
  
      ClearErrors();
  }
  </code></pre>
  
  <p>Below is my asp code that i tried to bind the data to the gridview,
  It is a template field.</p>
  
  <p><code>&lt;asp:EntityDataSource ID="CompanyDataSource" runat="server" ConnectionString="name=ReportsEntities"
      ContextTypeName="Nirvana.Factory.ReportsDbModel.ReportsEntities" DefaultContainerName="ReportsEntities"
      EnableFlattening="False" EnableDelete="True" EnableInsert="True" EnableUpdate="True"
      EntitySetName="T_W_Company" OnDeleted="MasterFundsDataSource_Deleted" OnDeleting="MasterFundsDataSource_Deleting"
      OnInserted="MasterFundsDataSource_Inserted" OnInserting="MasterFundsDataSource_Inserting"
      OnUpdated="MasterFundsDataSource_Updated" OnUpdating="MasterFundsDataSource_Updating" AutoGenerateWhereClause="true"&gt;
              &lt;WhereParameters&gt;
          &lt;asp:ControlParameter Name="CompanyID" ControlID="CompanyDropDown" PropertyName="SelectedValue"
              DbType="Int64" /&gt;
      &lt;/WhereParameters&gt;
  &lt;/asp:EntityDataSource&gt;</code></p>