Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to get value from onegridview and send it to other gridview present in other page
Posted

Even though you have not tagged it as ASP.NET, whole question statement sounds you are working on web application. In order to transfer data from one page to other, you need to use one of the state management techniques. Look here:
MSDN: ASP.NET State Management Overview[^]
State management in ASP.NET - 1[^]
ASP.Net State Management Techniques - 2[^]
 
Share this answer
 
VB
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
       If e.CommandName = "select" Then



           GridView1.FooterRow.Visible = True

           '' for navigate other page or....
            Dim i As Integer
          i = e.CommandArgument()
             Dim row As GridViewRow
           row = GridView1.Rows(i)

           Session("name") = row.Cells(1).Text
           Session("mob") = row.Cells(2).Text
           Session("add") = row.Cells(3).Text
           Response.Redirect("Default4.aspx")




       End If
 '' In default4.aspx
use above sessions in default4. page and store this values in datatble and assign datatable to gridview present in default4.aspx
Dim dt As DataTable = New DataTable()
            
dt.Columns.Add("Name")
            dt.Columns.Add("MobileNumber")
            dt.Columns.Add("Address")
            Dim ro As DataRow
            ro = dt.NewRow()
            ro(0) =   Session("name").tostring()
            ro(1) =  Session("mob").tostring()
            ro(2) =  Session("add").tostring()
            dt.Rows.Add(ro)
 GridView1.DataSource = dt
            GridView1.DataBind()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900