hi i want to have the code for editing,updating n deleting data in gridvoiew
i tried a lot searching in google..i trid also but could not get the output....i want how to insert textboxes using the edit colums ....i want in detail pls help...

2.next is how to add rows dynamically to gridview n custom columns to gridview...if u answer many may find useful as this is the baic of gridview...pls do help...i want indetail...

this code may help you to find your solution

<%@Import Namespace= "System.Data.Oledb" %>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="datagrid.aspx.vb" Inherits="datagrid" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat ="server" >

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim conathors As New OleDbConnection
        Dim cmd1 As New OleDbCommand
    
        conathors = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DATA Source=e:\nitu\vb.net\database-for-pre.mdb")
        conathors.Open()
        
        cmd1 = New OleDbCommand("select fname,lname,id from new_user", conathors)
        dgrd.DataSource = cmd1.ExecuteReader()
        dgrd.DataBind()
      
        conathors.Close()

    End Sub
    
    Sub DataNavigateUrlFormatString()
        
    
    End Sub
    

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Datagrid HyperLink</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:DataGrid ID="dgrd" AutoGenerateColumns ="false" EnableViewState ="false" CellPadding ="10" runat ="server" >
    
    <Columns >
    
    <asp:BoundColumn HeaderText ="Student id" DataField ="id" />
    <asp:HyperLinkColumn HeaderText ="Detail" DataNavigateUrlField ="id" DataNavigateUrlFormatString ="detail1.aspx?id={0}" Text ="view Detail" />
    </Columns>
    
    </asp:DataGrid>
    <div>
    
    </div>
    </form>
</body>
</html>

hi ...
thanks a lot..i got how to edi,update,n delete..now i want to validate the textbox wen i press update...like i want to ckeck for null vlues entry...only numbers.......i am searching for javascript but no proper result...

any links ..pls post....

This article has been dead for over six months. Start a new discussion instead.