Can you have a datagrid control inside of a repeater control. If so, how do you reference the datagrid in code behind

Hello,

If anyone can help, it would be greatly appreciated. I have a repeater control and I want to place a datagrid inside of the repeater control's item template.

The problem is, I don't know how to reference the datagrid control in the code behind. Also, can I bind data into the headertemplate of the repeater control

such as a name. Actually I would only need a name.

0
awix1
10/17/2007 8:21:16 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
1059 Views

Similar Articles

[PageSpeed] 49

Don't know about GridView inside the Repeater, but did you thought about Repeater inside the Repeater?(Example below)

 

1    Protected Sub rptMain_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptMain.ItemDataBound
2            Dim item As RepeaterItem = e.Item
3    
4            If item.ItemType = ListItemType.Item Or item.ItemType = ListItemType.AlternatingItem Then
5                Dim childRepeater As Repeater = item.FindControl("rptChild")
6                Dim drv As DataRowView = item.DataItem
7    
8                childRepeater.DataSource = drv.CreateChildView("Child")
9                childRepeater.DataBind()
10           End If
11   
12       End Sub
13   
14   
 

 Also try to reference a GridView like in my example.

 


100 years live, 100 years learn
0
Access
10/18/2007 12:12:28 AM
Reply:

Similar Artilces:

How to place a DataGrid Control with in a DataGrid Control
Hi, I want to place a DataGrid control in a DataGrid control can any one plz tell me the procedure to place the control Thanks in Advance Krisamigo <!---<asp:DataGrid ID=dg_List runat=server><Columns><asp:TemplateColumn><ItemTemplate><asp:DataGrid ID=dg_List2 Runat=server></asp:DataGrid> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> ---> Hardik Joshi...

How can we create a Repeater Control Inside a DataGrid
Hi, I am trying to create a repeater control inside a DataGrid Control.  How can I do this? Does anyone have an example that I can look at to see how it is done? This is How I have the DataGrid:    <asp:DataGrid OnItemDataBound="test_ItemDataBound" ID="test" Runat="server" AutoGenerateColumns="False">    <Columns>     <asp:TemplateColumn HeaderText="Asset Class">      <ItemTemplate>       <asp:Repeater OnItemDataBound="rptAssetClass_...

refering to controls in a repeater control
Hey, (this is an example situation) I have a repeater control which displays a textbox. As the repeater control is 'run' when the page is loaded. I'd like to give a unique id to each textbox. ie: name1, name2, name3, name4 etc. And I'd also like to store the number of times the repeater control is 'iterated' through. I imagine the best way to store the number of times is to either return a values with my select query (Stored Procedure), or to increment a cached int each time I run through the repeater control. How would I assign a 'unique' id to each textbox? Thanks ...

Control No of records in DataGrid control
Hi I am having more than 5000 records in the table. I had set page size:50, its loading 5000 records and showing 50 records... working fine. But my requirement is when page is loading i need to get only 50 letest records from the database. If user clicks on next it need to be connected to database and get next 50 records. How i can put pointer at 50 th record? Is there any way to do this???... plz help Top function wont work for me. Hope the problem is clear regards cnu The SQLDataAdapter can limit the rowsets in one of the Fill() method overloads. Check it out in the ...

datagrid control in to Tabstrip control .
i need to insert a datagrid in a tabstrip seperator. is this possible? and in what way . Do you really mean Tabstrip "Seperator"? Or are you just trying to insert a DataGrid into a TabStrip control? ...

Can repeater control go inside datagrid column?
I am creating a document control. Each row of my datagrid will contain fixed information about date, title, description, text, etc. This row will be build off a documents table in my database. But, I want the last column in my datagrid to hold a variable number of links to media files that might be assigned to each document. This data will come from a second data table containing media links and their filetypes (i.e. word, pdf, mpeg, etc). The user can link multiple instances of a media type to one document. Each of these media links will have icons, I want everything to appear nicely...

javascript: Get clientid of a control inside a datagrid or a user control
Get clientid of a control inside a datagrid or a user control in client side so you can use this id in document.getelementById( ) for some client side programming function GetClientId(strid) {      var count=document.forms[0].length;      var i=0;      var eleName;      for (.id;" pos="eleName.indexOf(strid);" if(pos="">i=0; i < count; i++ )      {        eleName=document.forms[0].elements.id;        pos=eleName.indexOf(strid)...

Calendar Control inside Repeater, Handling Child control events in parent Data Control
Hi all,I've been researching a problem i have for a couple of days now and i'm still not sure how to even start to handle it.I'm essentially trying to build a page that will display custom form fields/controls for individual items/rows inside a repeater.I've got a fairly complex calendar i need to have working inside each individual row of the Repeater. The calendar is set up to fire the following events: OnDayRender="Calendar2_DayRender" OnSelectionChanged="Calendar2_SelectionChanged" OnVisibleMonthChanged="Calendar2_VisibleMonthChanged"My first question is how do i go about handling these...

Can't access my controls from a user control code behind
Helo All, I am creating this user control, and I just can't access the controls I have added to the user control from my code behind, I am using VS2005Tester Edition.. I have checked the designer class, and its not updated all the time with new controls information, any suggestions???? Thankssss What do you mean by cannot access the controls from code-behind - Visual studio doesn't show you intellisense or at runtime asp.net shows error? What i meant is that VS doesnt show the intellisense, which means that I can't access them in my codes...   ...

accessing certain databound control value from the code behind -- in a repeater control
I have a <asp:repeater> control  and in that I have a <asp:hyperlink> within the <ItemTemplate> tag.  I have to do some calculations regarding the parameter I am using in the hyperlink.  I have to do this in the code behind.  Say I have to get the propertyID from a table.  If its in the .ascx, then its easy - I can do <%# Eval("propertyID") %>.  But how do I access this from the code behind? In your HTML you write the code like this: <%# DoStuff(Eval("ProcedureID").ToString()) %>   And in your code behi...

DataGrid Inside a repeater control
Hi All, Lets see if someone can help me on this problem. A brief description about the problem is I want to display all the products from all the categories of a catalog in a page with the functionality that the use can add any item to his shopping basket. Say if there are 2 categories and each category has 2 products Category1 ---- Product1 (Add To cart button) --- Product2 (Add To cart Button) category2 --- Product3 (Add to Cart Buton) --- Product4 (Add to cart button) I was able to display this format in the page by using a datalist inside the datareapeter ...

Nest control inside collapsible panel-can't refer to it in code behind
I am new to Atlas and I am testing the collapsible panel. I can't refer to the repeater in the code behind because it is nested in the collapsible panel. I am using a master page but I don't think that is the problem. Shouldn't I be able to reference the repeater from the code behind with out using findcontrol? Here is the inline code: <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server"> <div class="heading">Current Activity</div> <atlas:ScriptManager runat="Server" ID="sm" EnablePartialRendering="true"></atlas:ScriptManager> <Cu...

How to reference a control inside a user control?
I have created a simple user control and when I press a button I want to load some data into one of its labels.  I can't use find control directly from the ContentPlaceHolder (I'm using a master template).  Apparently the user control is its own container.  How do I reference the user control's type?  If I use Object to cast the user control then I can't call FindControl on the user control.  Here's my example that doesn't work: Prefix:ControlName oControl = (Prefix:ControlName) oContentPlaceHolder1.FindControl("UserControlName"); ...

Custom DataGrid control in user control
Hi there, I have created a custom datagrid control which i reference within a user control and it's corresponding code behind page. The problem I am encountering is that when I click on the paging buttons in the datagrid no event is fired, however if I reference the same control from a page everything works fine. I'm not sure where I am going wrong and would be greatful for any help that can be offered. I have not posted the code here as there is quite a lot although should anyone feel that it would be helpful in them coming to a solution I would be more than willing to do so. Cheer...

Web resources about - Can you have a datagrid control inside of a repeater control. If so, how do you reference the datagrid in code behind - asp.net.presentation-controls

Wikipedia talk:Reference desk/Guidelines/Medical advice - Wikipedia, the free encyclopedia
I disagree with this implication that this section of the guideline represents the consensus. If you look at the last few years of discussion ...

Child sex abuse royal commission: Senior politician to be grilled over reference
A former deputy Premier will again take the stand on Tuesday to explain why he gave a positive job reference to a man he knew to have sexually ...

VA, reference pricing and the value of options
@hyperplanes eg, you can get free care at VA, or get a reimbursed at the reference price for care anywhere else. — Matthew Martin (@hyperplanes) ...

10 of the best movie references you’ll ever see in popular TV shows
I'm torn when it comes to breaking the fourth wall in TV shows . It can be a fun, clever way to connect with the audience, but it can also break ...

"As much as Poppy Bush scoffs at 'the D-word,' as he calls any reference to dynasty, the Bushes do consider ...
... re-defended myself: "Servants" seems like the right word for people who occupy the servants' quarters within a house, especially when the reference ...

'Enough with the Viagra references,' says the CEO behind the first FDA approved drug to boost women's ...
... the Fortune Most Powerful Women Next Gen conference. But the reaction to the pill still confounded her. "Enough already with the Viagra references," ...

Donald Trump prompts Nazi references
Some conservatives and political commentators say the GOP frontrunner's rhetoric has crossed the line

Arrow: Easter Eggs and DC Comics References in "Brotherhood"
This was a weird week for Arrow, in terms of the crazy minutia we generally look for.There were a [...]

Now you can bookmark Google image searches for later reference
Normally, image searches on Google are ephemeral things and gone the moment you close the browser tab. However, a new feature on the search giant's ...

The 5 Best Britney Spears References From Her 'Jane the Virgin' Visit
The 5 Best Britney Spears References From Her 'Jane the Virgin' Visit

Resources last updated: 12/7/2015 2:28:48 PM