Gridview SelectedIndex value set
<p>Work on Asp.Net C# .</p>

<pre><code>&lt;asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID"
                                DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView2_SelectedIndexChanged" OnRowCommand="GridView2_RowCommand"&gt;
                                &lt;Columns&gt;
                                    &lt;asp:CommandField ShowSelectButton="True" /&gt;
                                    &lt;asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False"
                                        ReadOnly="True" SortExpression="CategoryID" /&gt;
                                    &lt;asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" /&gt;
                                    &lt;asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /&gt;
                                &lt;/Columns&gt;
                            &lt;/asp:GridView&gt;
</code></pre>

<p>protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
    {</p>

<pre><code>   GridView2.FindControl("CategoryID").Text=2;
</code></pre>

<p>}</p>

<p>want selected column value change on ridView2_SelectedIndexChanged method .How to do ?</p>
