Solved

Pass values from gridview button control to another page

Posted on 2014-04-16
3
860 Views
Last Modified: 2014-04-16
I have a gridview in a page with three button controls in template fields. The gridview shows several different summary totals. For each button, on button click I want to open a 'popup' window that displays a details gridview for that row.  (The values I need to pass to the details gridview are columns 1 and 2. (lockbox and credit date).

Can someone help me with this?  I've seen examples for using a hyperlink button control but I'm using a regular button control.  Also, if I click the button within in a certain row does it make that row the 'selected row'?

Any help would be greatly appreciated.

Thanks.
0
Comment
Question by:imstac73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 40004661
Define the column in client side:

Client side:

<asp:TemplateField HeaderText="Popup" ShowHeader="False">
  <ItemTemplate>
    <asp:LinkButton ID="Popup" runat="server" CausesValidation="false" Text="Popup" CommandArgument='<%# eval("YourRowIDColumn") %>' oncommand="btnPopup_Command" />
   </ItemTemplate>
</asp:TemplateField>

Open in new window


Server side:

Protected Sub btnPopup_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)

   Dim myId As Integer = e.CommandArgument

---   Your changes goes here to popup another window using the id

Open in new window

End Sub
0
 

Author Comment

by:imstac73
ID: 40004915
Thanks EaswaranP

So I have two column values that I need to pass to the new window; how do I add the additional one to the 'eval' code?
0
 

Author Comment

by:imstac73
ID: 40004977
I figured it out...thanks so much for your help!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question