Getting datas from gridview for selected row?
<p>i'm new to asp.net. i'm doing one project. in that i've used one gridview and fetch datas from database using sqldatasource.
gridview code is</p>

<pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataSourceID="Library" CellPadding="4" ForeColor="#333333" 
    GridLines="None" OnRowDataBound="GridView1_RowDataBound" &gt;
    &lt;RowStyle BackColor="#EFF3FB" /&gt;
    &lt;Columns&gt;
        &lt;asp:BoundField DataField="Sl_No" HeaderText="Sl_No" SortExpression="Sl_No" /&gt;
        &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt;
        &lt;asp:BoundField DataField="Author" HeaderText="Author" 
            SortExpression="Author" /&gt;
        &lt;asp:BoundField DataField="Publication" HeaderText="Publication" 
            SortExpression="Publication" /&gt;
        &lt;asp:BoundField DataField="Available" HeaderText="Status" 
            SortExpression="Available" /&gt;
        &lt;asp:TemplateField HeaderText="Availability"&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:Image ID="Image1" runat="server" ImageUrl='&lt;%# Eval("Available") %&gt;' /&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:BoundField DataField="RIUserTaken" HeaderText="RIUserTaken" 
            SortExpression="RIUserTaken" Visible="False" /&gt;
        &lt;asp:TemplateField HeaderText="Taken By" ShowHeader="False"&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:Label ID="Label4" runat="server" Text='&lt;%# Eval("RIUserTaken", "{0}") %&gt;'&gt;&lt;/asp:Label&gt;
                &lt;asp:Button ID="SendRequest" runat="server" Text="Button" Visible="False" 
                    onclick="SendRequest_Click" CommandName="SendRequestCmd" /&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Taken Date" InsertVisible="False" 
            ShowHeader="False"&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:Label ID="Label3" runat="server" Text='&lt;%# Eval("TakenDate") %&gt;'&gt;&lt;/asp:Label&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
    &lt;/Columns&gt;
    &lt;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
    &lt;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&gt;
    &lt;SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /&gt;
    &lt;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&gt;
    &lt;EditRowStyle BackColor="#2461BF" /&gt;
    &lt;AlternatingRowStyle BackColor="White" /&gt; &lt;/asp:GridView&gt;
</code></pre>

<p>code  is one of the column of the grid view. if i click on that button, i've to store that button contains rows all datas in string variable. like
string slno="";
slno=gridview1.cells[0].text; (i'm not sure it is correct or not)
plz anyone help me??</p>

<p>thanks in advance :)</p>
