473,398 Members | 2,188 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,398 software developers and data experts.

Binding DataList to ArrayList

Hi:

I'm trying to bind a DataList to an ArrayList of POC object instances.

this.DataList.DataSource = BizEntity.thePOCs; // thePOCs is an ArrayList of
POC's which is member of BizEntity class
this.DataList.DataBind();

In the HTML I have an ItemTemplate with an expression that binds to a Fname
property of POC object like so:

<%# DataBinder.Eval(Container.DataItem, "Fname") %>

I get error saying Fname is not property of POC, but it is and it contains
data. Any ideas?

Thanks,
Charlie
Nov 16 '05 #1
2 8007
Hi,

Try to use this expression

<%# ((POC)Container.DataItem).Fname %>

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Charlie" <cf*******@radiustravel.com> wrote in message
news:ux**************@tk2msftngp13.phx.gbl...
Hi:

I'm trying to bind a DataList to an ArrayList of POC object instances.

this.DataList.DataSource = BizEntity.thePOCs; // thePOCs is an ArrayList
of POC's which is member of BizEntity class
this.DataList.DataBind();

In the HTML I have an ItemTemplate with an expression that binds to a
Fname property of POC object like so:

<%# DataBinder.Eval(Container.DataItem, "Fname") %>

I get error saying Fname is not property of POC, but it is and it contains
data. Any ideas?

Thanks,
Charlie

Nov 16 '05 #2
That worked. Thanks!
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OD**************@TK2MSFTNGP15.phx.gbl...
Hi,

Try to use this expression

<%# ((POC)Container.DataItem).Fname %>

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Charlie" <cf*******@radiustravel.com> wrote in message
news:ux**************@tk2msftngp13.phx.gbl...
Hi:

I'm trying to bind a DataList to an ArrayList of POC object instances.

this.DataList.DataSource = BizEntity.thePOCs; // thePOCs is an ArrayList
of POC's which is member of BizEntity class
this.DataList.DataBind();

In the HTML I have an ItemTemplate with an expression that binds to a
Fname property of POC object like so:

<%# DataBinder.Eval(Container.DataItem, "Fname") %>

I get error saying Fname is not property of POC, but it is and it
contains data. Any ideas?

Thanks,
Charlie


Nov 16 '05 #3

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

Similar topics

6
by: Thanh | last post by:
I created an ASP.NET project and dropped a DataList on the web form. I then wrote a simple class to return data: namespace Playing { public class PositionData { private string name; private...
4
by: Roger R. Smith | last post by:
Anyway I am having a problem with Web Service and DataList in ASP.NET. so the best way to explain it would be with the MSPetShop 3.0 Application. I submitted an order using the Forms on...
3
by: Kyong Kwak | last post by:
Hey all my second post! wanted to know if I can cache an entire control.. this is what I have.. Webform has header, nav, footer, and Usercontrol_1. Usercontrol_1 has a datalist and paging...
1
by: Laura K | last post by:
Can someone tell me where I went wrong. This is my code for binding data to a datalist. <script language="vb"> Sub Page_Load(Src As Object, e As EventArgs) Dim Con As New...
1
by: Paul L | last post by:
Hi, I have an issue with the OnSelectedIndexChanged event not firing for a DropDownList control which is in the ItemTemplate of a DataList. I have made an exact copy of the DropDownList control,...
3
by: Bob Lehmann | last post by:
Hi, I'm trying to bind an ArrayList to a DataList. I get the error DataBinder.Eval: 'System.String' does not contain a property with the name Name. I don't know what property of ArrayList...
1
by: npverni | last post by:
I have datalist binding to an arraylist of custom objects (defined in a class "PageItem"). What I am trying to do is access the source PageItem object in an ItemCommand event handler of the...
1
by: David Lozzi | last post by:
Howdy, I have a datalist which is displaying a list of categories and their associated sub categories in secondary datalists. Works great in a single column. Unfortunaly when i switch it to...
1
by: PANDY | last post by:
how to bind an arraylist of object to datalist control in asp.net?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.