473,396 Members | 1,996 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.

Repeater control with Arraylist

fix
Hi all,

I am trying to bind some data I got in an ArrayList, how is that possible? I
see no example in the help.
The code behind to bind is simple:

rptItems.DataSource = alist
rptItems.DataBind()

But I just don't know what to write in the ItemTemplate in the HTML.

Please help.
fix.
Nov 19 '05 #1
4 1375
Pretty much the same as you'd write with any other object you bind
against. E.g.:

<ItemTemplate>
Bla: <%# ((TypeOfObject)Container.DataItem).Whatever %> or <%#
DataBinder.Eval(Container.DataItem, "Whatever") %>
</ItemTemplate>

Nov 19 '05 #2
Pretty much the same as you'd write with any other object you bind
against. E.g.:

<ItemTemplate>
Bla: <%# ((TypeOfObject)Container.DataItem).Whatever %> or <%#
DataBinder.Eval(Container.DataItem, "Whatever") %>
</ItemTemplate>

Nov 19 '05 #3
fix
The things I insert to the Arraylist is not objects, it is some strings or
integers. So it doesn't have any "whatever" property. What do I do?
Thanks.
fix.

--

"Wilco Bauwer" <wi****@gmail.com>
???????:11**********************@f14g2000cwb.googl egroups.com...
Pretty much the same as you'd write with any other object you bind
against. E.g.:

<ItemTemplate>
Bla: <%# ((TypeOfObject)Container.DataItem).Whatever %> or <%#
DataBinder.Eval(Container.DataItem, "Whatever") %>
</ItemTemplate>

Nov 19 '05 #4
Container.DataItem just represents an item in the data source. In your
case you can just do <%# Container.DataItem %> instead.

Nov 19 '05 #5

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

Similar topics

1
by: Jax | last post by:
I have an arraylist of objects. This arraylist is bound to a repeater. That repeater then creates a set of controls like so <asp:repeater id="garmentRepeater" runat="server"...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
0
by: Mike K | last post by:
Hello, I have run into a strange situation. I have a control in which I am trying to sort the datasource of a repeater and bind the arraylist data back to the repeater. Whenever I do this I...
7
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
1
by: Alan Silver | last post by:
Hello, I have a page in which I'm trying to give the user the chance to manipulate a list of items. These are the price variations for a product, so each item consists of a name (eg, small,...
3
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%#...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
0
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation...
15
by: | last post by:
I dynamically create controls (textboxes) in a repeater control. I know their names (eg. TextBox1). How do I find the text of TextBox1 in the Form? FindControl does not seem to work.
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
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
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: 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
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.