populate a gridview from a selected row in another gridview

can someone give me an overview of how to grab a row from a gridview with a select button that is clicked to populate another gridview

 

Here is the markup for my gridview

<asp:GridView ID="grdContacts" runat="server" BackColor="#DEBA84"

BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3"

CellSpacing="2" AutoGenerateColumns="False">

<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />

<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />

<Columns>

<asp:CommandField HeaderText="Selected" ShowSelectButton="True" />

<asp:BoundField HeaderText = "Advertiser ID" DataField = "lngAID" />

<asp:BoundField HeaderText = "Organization Name" DataField = "txtOrgNameKey" />

<asp:BoundField HeaderText = "Contact Last Name" DataField = "txtACLname" />

<asp:BoundField HeaderText = "Organization Name" DataField = "txtOrgNameKey" />

<asp:BoundField HeaderText = "Contact Last Name" DataField = "txtACLname" />

<asp:BoundField HeaderText = "Standing Order" DataField = "ysnStandingOrder" />

<asp:BoundField HeaderText = "Hold" DataField = "ysnHold" />

</Columns>

<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />

<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />

<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />

</asp:GridView>

 

The selected event doesn't seem to fire when I click my selected button I am not sure what I have done wrong.

0
SIOPJman
12/2/2008 7:13:44 PM
asp.net.presentation-controls 72751 articles. 1 followers. Follow

1 Replies
329 Views

Similar Articles

[PageSpeed] 3

 alright this first link is how to control the on selected index changed....... there are two ways to do it ... you can do selected index then find the id you want and just go from there

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.selectedindexchanging.aspx

or if you use selectedrowchanged you have the row and you go from there.... once you have the data you have... you can just bind it in the following manner

here is an example 

http://www.dotnetspider.com/resources/21693-How-get-seelcted-row-from-gridview-button-click-uisng-row-command-event-c.aspx

 

then on selected index changed or selectedrow... you bind the other grid does that make sense?

 

 

since youre using a command you might want to do oncommand none theless its the same theory if you have questions.... write back 


+
Lvl FIVE THOUSAND DRAGON MASTER SOFTWARE ENGINEER
my friends call me MOI
0
moises
12/2/2008 7:55:30 PM
Reply:

Similar Artilces:

How To Populate A GridView From Another GridView's Selected Row Set
Hi, I am in a situation where i need to populate a gridview from another gridview's seleted rowset. The first gridview is showing some data from database . The data source table of the first gridview does not have any primary key because it has some aggregate results (i have used group by clause in the SQL query ). So the "DataKeyNames" property of the first gridview can not be set. The second gridview will be populated from the selected rows of the first gridview. As the first gridview does not have "DataKeyNames" property set, i can not f...

Selecting the multiple rows in GridView and inserting the selected rows to another Gridview & Performing some operations on it
 Dear All, I have become mad for solving this problem. Please Help me. I have a Gridview bound to a datasource. I inserted the CheckBox Control in Templet to select certain rows. Gridview1 contains some products id & name.I want to insert the selected rows in to second Gridview  and in the second Gridview I need to add two more colums AdvicedQty & AcceptedQty(TextBox Cotrol).The user will select few products in Gridview1 & clicks add which will be added another gridview then in second Gridview he enters the AdviceQty & AcceptedQty.After entering the data he cli...

Using a row selection in a gridview to create database rows for another gridview
Hi there, I have 2 gridviews on a form, the first displays some template rows from a database table.  The second displays some user specific rows (with additional data added to the template info) from the same table. They both work fine for displaying the info.  Now what I want to do, is allow users to 'select' a template row on the first gridview, and have that action automatically: create a new user-specific row, with added fields from profile data etc. insert it into the table then refresh the second gridview in order to show the new added row. C...

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one colum.now my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the data.now my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

Selecting a gridview row and keeping the last selected row in a gridview highlighted after mouse moves over a new row.
What is the best way to show a gridview row highlighted once selected and keep it highlighted once the mouse moves over a different row? Thanks, Steve hi,you can use <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="#FFFFFF" /> plz let me know if i misunderstood you Thanks for your help. One problem; however, is that after the row has been selected and I check the "grid.SelectedIndex" it has a value of -1 and not the index of the row that was selected on the grid. What do you recommend? Thanks, Steve hi, sorry i din...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

pass selected gridview row to another gridview on new page
hi people.. well i am stuck with the gridview problem.. i have a gridview on a page and when the user selects a gridview row then the user is redirected to a new page. then another gridview on this new page should show the selected gridview row from previous page... is it possible... please help me with this...  There's Always Something to learn in everything. HiI have did little in the Data moving from one GridView to another.Just take a look and modified as you want. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MoveRecord.aspx.cs&...

how to place a selected row from a gridview into another gridview by clicking a button
hi, In my application  i have binded the data from data base table to a grid view. my database table attributes are prodid,prodname ,price and qty. my grid view columns includes qty,prodname,price.i placed checkbox into my gridview and i placed a textboxes in the last column for placing required  qty from the available qty.after clicking on a checkbox of a perticular row  that selected row should be placed into another grid view by clicking on a submit button. the second gridview columns are serial no,prodname,qty(user required qty ), total price. in the last row of grid...

There is a Gridview Control in the tmplate field of another GridView Control.
    For instance,a gridview displays the information of the  students in a class.A table is recording the information except their mark.There is another table recording the mark of the students whose foreign key is the primary key of the previous table.   string strSQLconnection=".................."; SqlConnection sqlCononection=new SqlConnection(strSQLconnection); SqlCommand sqlCommand=new SqlCommand("select * from stuendent where classID=1",sqlConnection); SqlConnection.Open(); SqlDataReader reader=sqlCommand.ExecuteReader(); GridVie...

Problem in Using DropDownList Control to select a selected row of SqlDataSource that is under GridView Control
Hi all,In my SQL Server Management Studio Express, I have a database "ChemDatabase" that has a table "LabData"  formatted in the following way: SampleID int PRIMARY KEY, SampleName nvarchar(25), ChemicalName, nvarchar(25), Concentration decimal(6.2) with 5 rows of records in this .dbo table. In my Visual Web Developer Express, I created a website "RPD-TCE" for extracting a row of record from the LabData table by using a DropDownList, a GridView and a SqlDataSource.  I want to click DropDownList to list one number of S...

new row below selected row in gridview to display child gridview
Hello,   I have a gridview that up selected..shows the nested child grivdview. The problem I currently have is that it stuffs all the data into a column whcih blows the whole tbale out of whack. What I need to do is create a new row below the sleected row to house the new child grivdview. I have seen third party controls do this such as teleriks radgrid but I wont to do this with the gridview control.  Any articles on how to do this? Does AJAX support this? Any help is greatly appreciated.    ...

Select a row in GridView and show dependent Values in Other GridView on the basis of selection...
hi, i've a parent table which has many values in it.. i also have some child tables which contains other information.. these tables are linked through forein keys... now what i want to do is, i want to select a value from main table suppose, ID 10, and i want to display it in other gridview having the children table values of the ID 10. how can i achieve this scenario? Please let me know if i am not clear with my statements. Thank U-Jigzy-Please remember to click “Mark as Answer” on the post that helps you.This can be beneficial to other members reading the thread. You can have y...

select a row in gridview when focus it in gridview
i did that :        e.Row.Attributes.Add("onMouseOver", "this.style.background='#E2DED6';");        e.Row.Attributes.Add("onMouseOut", "this.style.background='#F7F6F3';");       e.Row.Attributes.Add("onclick", this.GetPostBackClientEvent(GridView2, "Select$" + e.Row.RowIndex.ToString()));       with this code my gridview will have colour distinct on the row where mouse position are, and when you click will select the row clicked. i want to navigate in gridvie...

Web resources about - populate a gridview from a selected row in another gridview - asp.net.presentation-controls

Facebook Fans Populate National Car Rental Playlist
... its Facebook fans are listening to, so the company teamed up with music-streaming service Songza to allow users who like its page to help populate ...

Facebook Launches Integrations With Spotify, Netflix and More to Populate the Ticker with Playable Content ...
A wide variety of media partners and news publishers have partnered with Facebook to allow uses to publish content to the site that can be immediately ...

Perish the populate thought
Population size and growth, resources and climate change are obviously linked.

Islamic State militants raping thousands of women to populate caliphate, Iraqi official claims
ISLAMIC State fighters are reportedly raping thousands of women in Iraq and Syria to mass-produce spawn who&#8217;ll follow in their footsteps. ...

Researchers craft bot to populate Wikipedia with gene data
In order to help make Wikipedia a better source of information for biologists …

Are Chuck Schumer and Steve Israel Working To Populate Congress In The Image Of Scoop Jackson?
History lesson: In 1972 and again in 1976, the Beltway's conservative Democratic Establishment had found its man. The preferred candidate of ...

Extreme Shrimps Could Possibly be Sent to Populate Europa, NASA Reports
Rimicaris hybisae live on the edges of hydrothermal vents 7,500 feet underwater whose temperatures reach 750 degrees Fahrenheit.

Glowing robotic tentacles populate this Petting Zoo
(Credit: Minimaforms) If you swing by the Petting Zoo in Orleans, France, don't expect to see goats. The robotic "pets" that reside there hang ...

CNN.com - Millionaires populate U.S. Senate - Jun. 13, 2003
The U.S. Senate showed once more why it's sometimes called the millionaires' club.

Pokémon 2DS bundles soon to populate Australian store shelves
Australian gamers who have yet to pick up Pokémon X and Pokémon Y will be able to purchase one of two new Nintendo 2DS system bundles on June ...

Resources last updated: 12/24/2015 11:41:42 AM