Link to home
Start Free TrialLog in
Avatar of Robinsonx6
Robinsonx6Flag for Mauritius

asked on

Urgent: Using a Repeater getting the rowdata

Hi iam trying to pass the underlying data of an ASP:Repeater item to a custom control which will be used to format the Repeater,as follows:-  How do i do this correctly so i can access the Items data within my control. PS you will notice i have a public property in my ItemControl called ItemData which im hopeing can be passed a DataRow.


<asp:Repeater id="rptrLocations" runat="server">
<ItemTemplate>
<cc3:Item id="Item1" ItemData="?????????????" runat="server"></cc3:Item> // this is my custom control
</ItemTemplate>
</asp:Repeater>
ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robinsonx6

ASKER

Thanks for this bit of help. im trying it in a bit, but it looks ok so here is the points
Sorry i get the following error

Parser Error Message: Cannot create an object of type 'System.Data.DataRow' from its string representation '<# ((DataRowView)Container.DataItem).Row #>' for the 'ItemData' property.

 <%@ Import Namespace="System.Data" %>

[C#]
<cc3:Item id="Item1" ItemData='<%# ((DataRowView)Container.DataItem).Row %>'  runat="server"></cc3:Item>

[VB.NET]
<cc3:Item id="Item1" ItemData='<%# DirectCast(Container.DataItem,DataRowView).Row %>'  runat="server"></cc3:Item>