Passing values from Datagrid to another form

This is a discussion on "Passing values from Datagrid to another form" within the ASP.NET Forum section. This forum, and the thread "Passing values from Datagrid to another form are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 11th, 2005, 18:43
New Member
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Passing values from Datagrid to another form

I am trying to pass values from my datagrid from one form (webform1.aspx) to another form (webform2.aspx), but I don't want to transfer the data to another datagrid. I want them to display in text boxes on the second form (webform2.aspx). I am using a DataSet to populate the datagrid.


Caryma
Reply With Quote

  #2 (permalink)  
Old Aug 16th, 2005, 07:53
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Have you tried an editable datagrid? Its a built-in feature, which means you dont need 2 seperate webforms.
Reply With Quote
  #3 (permalink)  
Old Aug 16th, 2005, 13:37
New Member
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Smookie,

I think I understand what you are talking about. In that case would it just display the select record in the datagrid? If so I am trying to accomplish passing the value of the record to a form that doesn't have a datagrid and more of your generic input form.


caryma
Reply With Quote
  #4 (permalink)  
Old Aug 16th, 2005, 13:59
New Member
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I have also tried to pass the value using variables.

I have created a pushbuttom column on the datagrid with CommandName cmdEdit.

I used the following code to handle the event:

Private Sub cmdEdit(ByVal Sender As Object, ByVal E As DataGridCommandEventArgs)


Dim strssn As String = E.Item.Cells(0).Text
Dim strName As String = E.Item.Cells(0).Text

Response.Redirect("new_hire_update.aspx?SSN=" + strssn)


Everytime I push the button it just opens the same page new_hire_view.asp which is the original page with the datagrid
Reply With Quote
  #5 (permalink)  
Old Aug 17th, 2005, 08:06
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
sounds to me like you simply need a HyperLinkColumn in your datagrid:

for example:

Code: Select all
<asp:DataGrid ID="dgrd1" AutoGenerateColumns="False" Runat="Server">

<Columns>
 <asp:BoundColumn HeaderText="Name" DataField="strName" />
 <asp:HyperLinkColumn HeaderText="SSN" DataNavigateUrlField="strSSN" DataNavigateUrlFormatString="new_hire_update.aspx?SSN={0}" Text="Edit" />
</Columns>

</asp:DataGrid>
Reply With Quote
Reply

Tags
passing, values, datagrid, form

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variables values using POST sudhakararaog Web Page Design 2 Mar 18th, 2008 08:12
Taking values from a form without sending it... Mazinger JavaScript Forum 4 Jan 8th, 2008 18:39
Setting Form Values to Previously Entered Values masonbarge PHP Forum 6 Oct 17th, 2006 17:36
form not updating values djanim8 Classic ASP 0 Dec 10th, 2005 19:05
Passing form variable between pages rhoov Classic ASP 8 Dec 16th, 2003 14:59


All times are GMT. The time now is 16:02.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43