?
Solved

Urgent:  Using a Repeater getting the rowdata

Posted on 2005-05-16
4
Medium Priority
?
251 Views
Last Modified: 2010-04-07
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>
0
Comment
Question by:Robinsonx6
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
b1xml2 earned 2000 total points
ID: 14010142
<%@ 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>

The DataRowView's Row property is of the type DataRow
0
 
LVL 2

Author Comment

by:Robinsonx6
ID: 14010222
Thanks for this bit of help. im trying it in a bit, but it looks ok so here is the points
0
 
LVL 2

Author Comment

by:Robinsonx6
ID: 14011208
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.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 14011234

 <%@ 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>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question