Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have to 1st look at this gridview's events with simple insert, update, delete...Here is the link <a href="http://www.dotnetspider.com/resources/40129-grid-view-save-edit-update.aspx" rel="nofollow">http://www.dotnetspider.com/resources/40129-grid-view-save-edit-update.aspx</a></p> <p>Then see this link <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.buttonfield.commandname.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.buttonfield.commandname.aspx</a> It may surly helps you.</p> <pre><code>void CustomersGridView_RowCommand(Object sender, GridViewCommandEventArgs e) { if(e.CommandName=="Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = CustomersGridView.Rows[index]; TableCell contactName = selectedRow.Cells[1]; string contact = contactName.Text; Message.Text = "You selected " + contact + "."; } } </code></pre> <p>Gridview Looks Like This</p> <pre><code>&lt;asp:gridview id="CustomersGridView" datasourceid="CustomersSqlDataSource" autogeneratecolumns="false" onrowcommand="CustomersGridView_RowCommand" runat="server"&gt; &lt;columns&gt; &lt;asp:buttonfield buttontype="Button" commandname="Select" headertext="Select Customer" text="Select"/&gt; &lt;asp:boundfield datafield="CompanyName" headertext="Company Name"/&gt; &lt;asp:boundfield datafield="ContactName" headertext="Contact Name"/&gt; &lt;/columns&gt; &lt;/asp:gridview&gt; </code></pre> <p>You can also apply <code>CommandName="Edit", CommandName="Delete" instead of CommandName="Select"</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload