473,387 Members | 1,504 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,387 software developers and data experts.

Using Findcontrol to search for a control inside a gridview templa

How can I use Findcontrol inside a master gridview's RowDatabound event to
search for another gridview (detail) control that is inside an ASP Panel, in
a template column of the master gridview?
Sep 17 '08 #1
1 1979
Suppose ur .aspx code goes like dis:
<asp:GridView ID="GridView1" runat="server"
OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="p1" runat="server">
<asp:GridView ID="GridView2" runat="server">
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

The RowDataBound event wl have the following code:

protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
GridView gv2 = (GridView)e.Row.FindControl("GridView2");

}

Thanks,

Vijeta

Sep 18 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: clintonG | last post by:
Briefly stated, my problem is accessing and 'setting' properties of a label control declared in the template of another control noting that the other control is an instance of the beta 2...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
2
by: Bruno Alexandre | last post by:
Hi guys, I have this code: Dim gv As GridViewRow Dim str As String = "" Dim dd As DropDownList For Each gv In gvItems.Rows If gv.RowType = DataControlRowType.DataRow Then
7
by: WT | last post by:
Hello, It seems that when a control is set into a ContentPlaceHolder in a page using a MasterPage, it's id is change and FindControl(ID) no more works, is it normal, how to override this or...
0
by: Stan SR | last post by:
Hi, I need to customize a pargertemplate with these items a arrow to go back to the 1rst page a arrow for the previous page a dropdownlist with the page indexes a arrow for the new page a...
1
by: HockeyFan | last post by:
I have the following string from one of the controls, inside gridview, inside a control, inside a repeater item. rptBorrower_ctl00_ctlAuthorizedSigners_gvAuthorizedSigners_ctl04_ The control was...
2
by: DC | last post by:
Hi, I am using a GridView to present data in a DataTable, which I store only in ViewState and when the user hits the "OK" button the rows in the DataTable will be used to execute transactions. ...
2
by: johnix | last post by:
i am very newbie of asp.net.. i dont know how to get the value for my update event or display ii, from the textbox in gridview. code in my html <form id="form1" runat="server"> <div>...
9
by: AAaron123 | last post by:
I'm this far in determining the correct code to find a textbox I need to set. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.