GridViewCosts.SelectedRow.Cells[1].Text dont work with itemTemplate
<p>I have this  gridView: </p>

<pre><code>&lt;div class ="gridView"&gt;
    &lt;asp:GridView ID="GridViewCosts" runat="server" ShowFooter="True" ShowHeaderWhenEmpty="True"
        AutoGenerateColumns="False" OnRowDeleting="GridViewCosts_RowDeleting" Width="387px"
        OnSelectedIndexChanged="GridViewCosts_SelectedIndexChanged"
        OnPageIndexChanging="GridViewCosts_PageIndexChanging"
        AllowPaging="True"
        CssClass="mGrid"  
    PagerStyle-CssClass="pgr"  
    AlternatingRowStyle-CssClass="alt" PageSize="5"&gt;
&lt;AlternatingRowStyle CssClass="alt"&gt;&lt;/AlternatingRowStyle&gt;
        &lt;Columns&gt;
            &lt;asp:BoundField DataField="Id" HeaderText="Номер" /&gt;
              &lt;asp:TemplateField HeaderText="Стойност"&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="TextBox2" runat="server" Text='&lt;%# Bind("Value") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Label2" runat="server" Text='&lt;%# Bind("Value") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;ControlStyle Width="100px" /&gt;
            &lt;/asp:TemplateField&gt;
</code></pre>

<p>And in code behind i Want :</p>

<pre><code> protected void GridViewCosts_SelectedIndexChanged(object sender, EventArgs e)
        {
            TextBoxValue.Text = GridViewCosts.SelectedRow.Cells[1].Text;
}
</code></pre>

<p>this is not working when the column Value is TemplateField. If the column is BoundFIeld it's working . What should i do ?</p>
