473,408 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Populates GridView2 based on selected row from GridView1

Greetings! Help with gridviews. I have 2 gridview on my page: on GridView1 I have a column with select link, Id and Name which looks like this:

Select | Id | Name
select | 101 | Jack
select | 102 | Cath

Now, what I am trying to do is let's say, i clicked the select from the first row which is Jack, now my GridView2 will display the products ordered by Jack which looks like this:

Id | ProductID
101 | 111
101 | 222
101 | 333

and if Cath whom I selected, GridView2 will change the display products which ordered by Cath:

Id | productID
102 | 111
102 | 333
102 | 555

In short, I am trying to populate GridView2 based on the selected row from the GridView1. I am using asp.net with c#. Kindly help me with this, thank you very much in advance. God bless :)
Jun 7 '13 #1
1 1271
Frinavale
9,735 Expert Mod 8TB
You can handle the GridView's SelectedIndexChanged event.

In that event, retrieve the ID of the person selected, execute your query to retrieve product orders for that person, set the DataSource of GridView2 to the data retrieved from the database and then call the DataBind method on GridView2.

-Frinny
Jun 7 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Enterprise | last post by:
Hi, I have a extended combo box(mybox) that gets its values from a Table. Is there anyway to assign for the on click event procedure the zero based selected array to another array that's public?...
4
by: Neil | last post by:
I have a gridview which is being populated with no problems. I want to be able to reference the data from the cells in the row but having followed an example on MSDN cannot get any data to be...
2
by: Brian Henry | last post by:
say I have a databound combo box, which allows for text entry still (DropDownStype = DropDown in this case). now, If the user doesn't enter manually an item in the data bound list, nothing...
0
by: spowel4 | last post by:
VB 2005: Using an xml file as the data source, I need to fill a listbox with data based upon what was selected in a combobox. In other words, my data consists of a list of customers in a...
0
by: nityaprashant | last post by:
hello.. i had done below logic again.. but it doesn't give selected row's product name. it's gives all row's product name...particularly last row's product name.. i need selected row's...
0
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hi, I have created a second gridview when customer clicks on select link with this code: Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As...
2
beacon
by: beacon | last post by:
Hi everybody, I have a form that has a combo box that asks the user to select the program they work on. Once the user selects the program, a SQL statement populates the row source for 4 staff...
1
by: mldardy | last post by:
I really hope this makes sense to someone because I really need some assistance with this: I have a asp page that I am working on that has as many as 4 dropdownlists depending on what I choose in...
0
by: Pwintwahsoe | last post by:
protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView2.PageIndex = e.NewPageIndex; selectedCheckboxes(); BindGrid();...
8
Ewan
by: Ewan | last post by:
Hi I have a gridview which should populate based on some criteria that the end user selects. To enable the user to enter the required criteria i have added some Web Controls like Textbox,Drop...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.