<%@ Page Language="VB" AutoEventWireup="false" CodeFile="grid.aspx.vb" Inherits="grid" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border = "0" cellpadding = "0" cellspacing = "0">
<tr>
<asp:Label ID = "lbmsg" runat = "server" ></asp:Label>
</tr>
<tr>
<td>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames = "CountryCode" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowCommand="GridView1_RowCommand" OnRowDeleting = "GridView1_RowDeleting" ShowFooter="True" >
<Columns>
<asp:TemplateField HeaderText="Country Code" SortExpression="CountryCode">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("CountryCode") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtCountryCode" runat="server" Text='<%# Bind("CountryCode") %>'></asp:TextBox>
</EditItemTemplate>
<%-- <FooterTemplate>
txtCountryCode
</FooterTemplate>--%>
</asp:TemplateField>
<asp:TemplateField HeaderText="Country Name" SortExpression="CountryName">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("CountryName") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtCountryName" runat="server" Text='<%# Bind("CountryName") %>'></asp:TextBox>
</EditItemTemplate>
<%-- <FooterTemplate>
txtCountryName
</FooterTemplate>--%>
</asp:TemplateField>
<asp:TemplateField HeaderText="Edit" ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<FooterTemplate>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="AddNew" Text="Add New"></asp:LinkButton>
</FooterTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" ShowHeader="True" />
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
(vb code)
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs)
'''pls help me how to delete row in gridview using confirmation""
End Sub