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

Problem with nested Repeater and ItemCommand Event

Hello all

I have got a problem with a nested repeater and the ItemCommand Event.
I am adding handler for the ItemCommand and ItemBound. The ItemBound
works perfect but I cant seem to get the linkbuttons to work with
ItemCommand in the inner repeater. Can someone please help me?

The following code (almost) is my problem!

ASP CODE
--------
<asp:Repeater id="rptArticleGroup" runat="server" Visible="True">
<ItemTemplate>
<TR><td colspan="4">
<u><%#Container.DataItem("ArticleGroupname")%></u>
</td></TR>

<asp:Repeater id="rptArticles" runat="server">

<ItemTemplate>
<tr><td width="140">
<%#Container.DataItem("ArticleName")%>
</td>
<td width="170">
<asp:LinkButton id="lbuChangeArticle" runat="server"
CommandName="Change" CausesValidation="false">[Change
Article]</asp:LinkButton>
</td>
<td width="75">
<asp:LinkButton id="lbuDeleteArticle" runat="server"
CommandName="Delete" CausesValidation="false">[Delete
Article]</asp:LinkButton>
</td></tr>
</ItemTemplate>

</asp:Repeater>

</ItemTemplate>
<SeparatorTemplate>
<tr><td valign="top" colspan="3">
<hr /></td></tr>
</SeparatorTemplate>
</asp:Repeater>

VB.net Code
-----------
Sub Page_Load
rptArticleGroup.DataSource = ds
rptArticleGroup.DataMember = "ArticleGroups"
rptArticleGroup.DataBind()
End Sub

Sub rptArticleGroup_ItemDataBound

rptArticles = CType(e.Item.FindControl("rptArticles "), Repeater)

If Not IsNothing(rptArticles ) Then
AddHandler rptArticles.ItemCommand, AddressOf rptArticles_ItemCommand
AddHandler rptArticles.ItemDataBound, AddressOf
rptArticles_ItemDataBound

rptArticles.DataSource = ds
rptArticles.DataMember = "Articles"
rptArticles.DataBind()
End if

End Sub

Sub rptArticles_ItemDataBound

lbuDeleteArticle= CType(e.Item.FindControl("lbuDeleteArticle"),
LinkButton)
If Not IsNothing(lbuDeleteArticle) Then
lbuDeleteArticle.Attributes.Add("onclick", "return confirm('Är Are
you sure you want to delete this?');")
End If

End Sub
Nov 18 '05 #1
0 3950

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

Similar topics

1
by: Mark Fox | last post by:
Hello, I have a repeater and in each itemtemplate I have a radiobuttonlist. I am attempting to figure out how on postback I could iterate through the rows displayed by the repeater and for...
2
by: Jorge Ayala | last post by:
Well I'm trying to catch and act upon a button event that is placed within the item template of a repeater control. Yet the code I'm using isn't working. What I've seen out there to explain how...
2
by: Stan | last post by:
I cannot make the link buttons fire ItemCommand from repeater control. Here is the code: <asp:repeater id=rptLetters runat="server"> <itemtemplate> <asp:linkbutton id="lnkLetter"...
3
by: Leigh Webber | last post by:
I have an HTMLAnchor control on my aspx page. When it's not inside a repeater, it works fine. When I put it inside a repeater control, the handler never gets fired. I have a handler for the...
3
by: Joel Daniels | last post by:
Hello, I am trying to determine the proper way to access the underlying data row for a Repeater item in the ItemCommand event. In the page load event, I bind the Repeater data source to a...
1
by: Rob Rutherford | last post by:
I have a Repeater on an ASP.NET page. If I click a Button in the Repeater, the Repeater's ItemCommand event fails to fire. If anyone can explain why it doesn't fire I'd be grateful. Here's the...
4
by: Antonio Carpentieri | last post by:
Hi all, in my previous post I've wrong typed some tems.. this is the corrected post. in a aspx page I have a repeater like this: <asp:repeater id=repeaterResults runat="server"...
0
by: riddion | last post by:
Hello. I am having problems with the repeater webform control. Inside the <ItemTemplate> section I have a Calendar control. This is for so the user can choose a different date on each of the...
2
by: Josh | last post by:
I have a nested repeater situation with a Link Button on the nested repeater. However when the link button is clicked I get a postback but the event never takes place. I'm trying to wire up the...
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
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...

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.