how to pass the controls from child gridview to parent gridview in c#

 Hai.

how to pass the controls from child gridview to parent gridview in c#

0
rupeshs
2/7/2009 7:33:25 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
753 Views

Similar Articles

[PageSpeed] 39

Hi:

 

You can get the controls in ChildGridView like below. So if you want to get the reference of the control in ParentGridView, you can put them in ParentGridView event handler(like OnRowEditing .etc)

  

    GridViewRow parent_row = ParentGridView.Rows[parent_index];

    GridView ChildGridiView =

        (GridView)parent_row.FindControl("ChildGridView");

    GridViewRow child_row = ChildGridiView.Rows[child_index];

    Label titleid_lbl = (Label)child_row.FindControl("titleid_lbl");

 

For more information on this, please refer to below links.

http://msdn.microsoft.com/en-us/library/aa992038.aspx

http://www.codeguru.com/columns/vb/article.php/c12647

http://www.codeguru.com/columns/vb/article.php/c12675__3/

http://www.codeproject.com/KB/aspnet/EditNestedGridView.aspx

http://www.codeproject.com/KB/aspnet/MultiNestMDGridview.aspx

 

 

If you still have any problems on this, please let me know.

 

 

Regards,

Lynn

 

 

===============

Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

 

 

0
Lynn
2/12/2009 4:07:05 AM
Reply:

Similar Artilces:

GridView child of GridView
I have a Parent GridView and when you click in the Edit one of the columns has a Template Field which has a Child GridView. When you click Edit on the Child GridView I have a Template Field that has a TextBox. How to I retreive this value of the TextBox? GridViewParent-- GridViewChild (Edit - Template Field containing this GridViewChild)----- TextBox inside Template Field in GridViewChild. Thank you.Peace in ChristMarco Napolihttp://www.ourlovingmother.org What you can do as a solution is to override the RowDataBound and try to find the child GridView control. Once you get a reference to...

OnBubbleEvent with Button (child control) in GridView (parent control)
I have a button (created at runtime) inside the gridview.  I'm having a hard time telling the grid view that row 1 (the row which was selected when the button is clicked) is selected. Here's my code so far:  protected void ContentsGrid_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { counter++; //Display Imagebutton for View in column 1 ImageButton imgView = new ImageButton(); imgView.ID = "imgView" + 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...

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...

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...

Gridview control in C#.net
Hi , I am getting error (Object reference not set to an instance of an object.) while trying to update and delete the datas in gridview control. This is the code which i have writen . could anyone assist me on this.     public partial class custom : System.Web.UI.Page {public string connectionstr = System.Configuration.ConfigurationManager.AppSettings["ptcon"]; MySqlConnection conn;MySqlCommand cmd = new MySqlCommand(); DataSet ds = new DataSet();MySqlDataAdapter da = new MySqlDataAdapter();protected void binddata() {conn = new MySqlConnection(co...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

Getting the control id of a control inside gridview control
 uhmm.. a little bit confusing regarding my subject because i dont know how to say it...by the way my problem is how can i get the id of a control (e.g. textbox) inside the gridview... and the textbox is in the templatefield... is there any way i can get its id??  hoping i could get a reply as soon as possible... Regards,MhaeyPlease remember to click “Mark as Answer” on the post that helps you.. =) What do you want's to do by getting the id of the Text box? Do you want's to find particular Textbox with certain id ? Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MC...

How GridView control pass correctly params to ObjectDataSource Control?
Hi, What if I have: a GridView, a ObjectDataSource, a class like this: <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"><Columns><asp:CommandField ShowEditButton="True" /><asp:BoundField DataField="AppId" HeaderText="RoleId" ReadOnly="True"/><asp:BoundField DataField="RoleId" HeaderText="RoleId" ReadOnly="True"/><asp:BoundField DataField="RoleName" HeaderText="RoleName />&l...

Expandable Parent/Child GridView control
Hi, I was just wondering if the .NET 2.0 Data Controls allow for data to be presented in an expandable/collapsable gridview style control (with +/-).  I have multiple rows which act as a parent (totals rows), and each of these rows has multiple child rows (sub total rows). What I need to be able to do is display all parent rows by default, but allow the child rows to be shown when the particular row is expanded. Is this possible? Kindest Regards...

help me! WHY CAN THE TOP GRIDVIEW DETECT CONTROLS BUT THE SECOND GRIDVIEW NOT DETECT CONTROLS?!
Hi guys, two gridviews, same page, but one cant define paramters, the other one can.  the one that works is the first example, the one that doesnt work is the second example.  what is the difference? if you could highlight why example two doesnt detect contorls that would be great!!! example one <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2&qu...

Passing values from a parent web control to child web control
I have a parent control which called CONTROL1 and a child control witch called CONTROL2 I would link to pass a value from the parent control to the child control. In the parent control(CONTROL1) I have the following Event Handler . private void btn_Handler(object sender, EventArgs e) { …      if (Page.IsPostBack) {              // Send the officer names to the child controls.             if(m_nameList.SelectedItem.Text != "")     ...

Help Req: !!! :- On Disabling Controls Present inside a Gridview control
Hi All, We have A requirement Where we have disable controls inside a grid.These controls can be textbox, DropDownlist (in TemplateField), ComandField present inside the grid.We have to call a generic method for doing the same .(since it can be done for multiple grid.) PFB the code snippet we use. Which disables all the controls inside the page.The bolded part of the code is used to loop inside a grid view.(Not Working.)Is this ideal way to deal with the requirement.Or can someone suggest be a better way.        public void DisableMe(Page p1, st...

Gridview parent and formvew child user control
I have a form defaulting to edit mode which is a user control, enable viewstate is set to false.  The form gets it's ID select parameter from a gridview on the parent page.  The grid displays at the top of the page and when you select a record the form populates with the fields beneath the gridview.  I would like to clear the screen after the update button on the form is clicked.  Currently when you click the update button on the form the fields do update but the same record stays on the screen. When the form is finished updating, I would like to set the gridview ind...

Web resources about - how to pass the controls from child gridview to parent gridview in c# - asp.net.presentation-controls

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

TERROR IN JAKARTA: 'Situation under control' after explosions, gunfire erupt in Indonesian capital
At least six people are dead, including three police officers, after several explosions at the Sarinah shopping mall in an apparent multi-site ...

DFES downgrades bushfire in Dunsborough as it is contained, but not under control
A BUSHFIRE south of Dunsborough has been contained but is not yet under control.

WA fires: threatening Jindalee blaze brought under control
A fire that was at one stage a threat to lives on homes in Jindalee on Thursday has been brought under control.

Queensland police shut down out-of-control party in Berserker, Rockhampton
Police shut down a party of 150 young people who had gathered at a house in Berserker, Rockhampton on Friday night.

BMW recalls i8 for stability control problem
... , BMW , Safety , Coupe , Hybrid , Performance BMW will recall a small number of 2015 i8s because of a problem with the dynamic stability control ...

ESI cost control and networks
There is an interesting discussion thread on Twitter about how the way Medicare for All saves money is by significantly reducing provider, device, ...

While No One Was Watching, Obama Took Control of the Courts
... and President Obama’s legacy.” It didn’t favor conservatives but there was a dramatic shift to the far left. The appellate is under the control ...

Apple has landed a very rare sponsorship deal to ensure it has control of the hottest ticket in San Francisco ...
Apple has signed up for the first time to become a sponsor of the Super Bowl Host Committee, Daniel Roberts at Yahoo Finance reported. It's ...

Leonardo DiCaprio: The Oscar stuff is ‘completely beyond my control at this point’
... last night’s London premiere of The Revenant . Leo is looking pretty good these days. He’s de-bloated, his facial hair is very much under control, ...

Resources last updated: 1/17/2016 3:37:22 AM