473,666 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Biniding custom objects to DataRepeater

Hi,

How can I bind ArrayList of my object to DataRepeater ?
I have 2 classes:

public class Movie {
private String _Name = "";
private Double _Price = 0;

// getters and setters

public Item() {}
}
public class Items {
private Movie _Movie = null;
private Int16 _Quantity = 1;

// getter and setter
}

How can I use ArrayList of Items as a DataRepeater.Da taSource ?
What should I use in DataBinder.Eval ?

<ItemTemplate >
<%# DataBinder.Eval (Container.Data Item, "Name") %><br>
</ItemTemplate>
thanx, Neven
Nov 19 '05 #1
2 2055
DataBinder.Eval is a smart cookie. Specify the name of a property (getters)
and you're all set.

Alternatively, you can use:

((Movie)Contain er.DataItem).Na me (ie, cast Container.DataI tem to the
individual items in your arraylist)...bu t I prefer DataBinder.Eval :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Neven Klofutar" <neven.klofutar *r.e..mo*****@v ip.hr> wrote in message
news:u5******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

How can I bind ArrayList of my object to DataRepeater ?
I have 2 classes:

public class Movie {
private String _Name = "";
private Double _Price = 0;

// getters and setters

public Item() {}
}
public class Items {
private Movie _Movie = null;
private Int16 _Quantity = 1;

// getter and setter
}

How can I use ArrayList of Items as a DataRepeater.Da taSource ?
What should I use in DataBinder.Eval ?

<ItemTemplate >
<%# DataBinder.Eval (Container.Data Item, "Name") %><br>
</ItemTemplate>
thanx, Neven

Nov 19 '05 #2

Or you can use

<%# DataBinder.Eval (Container.Data Item, "Movie.Name ") %>
Thanx, Neven
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uN******** ******@TK2MSFTN GP15.phx.gbl...
DataBinder.Eval is a smart cookie. Specify the name of a property (getters) and you're all set.

Alternatively, you can use:

((Movie)Contain er.DataItem).Na me (ie, cast Container.DataI tem to the
individual items in your arraylist)...bu t I prefer DataBinder.Eval :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Neven Klofutar" <neven.klofutar *r.e..mo*****@v ip.hr> wrote in message
news:u5******** ********@tk2msf tngp13.phx.gbl. ..
Hi,

How can I bind ArrayList of my object to DataRepeater ?
I have 2 classes:

public class Movie {
private String _Name = "";
private Double _Price = 0;

// getters and setters

public Item() {}
}
public class Items {
private Movie _Movie = null;
private Int16 _Quantity = 1;

// getter and setter
}

How can I use ArrayList of Items as a DataRepeater.Da taSource ?
What should I use in DataBinder.Eval ?

<ItemTemplate >
<%# DataBinder.Eval (Container.Data Item, "Name") %><br>
</ItemTemplate>
thanx, Neven


Nov 19 '05 #3

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

Similar topics

2
8933
by: muhamad | last post by:
Hi, How can I use the DataRepeater in CSharp , this control exists in VB6 ,i never used it . I want to insert into the DataRepeater TextBoxs that will show all the time data from the database . Does anyone have an example or direction ?
3
3358
by: | last post by:
Hi, NG! Is there any updated version (.Net) of the Datarepeater control or do I have to use the old (VS6.0) version? Thanks. pax
1
1541
by: Chris Leffer | last post by:
Hi. I have a DataRepeater that is filled with the results of a query based on four criteria fields. If one of these criterias is informed, I don't need to display a certain column in my DataRepeater. I can do that using an If expression on the HTML to conditionally show the column, but is it possible to do that using code-behind only? Regards, Chris Leffer
3
1878
by: Stephen | last post by:
Hi, Does anyone have a sample of a DataRepeater with Radiobuttons? I am trying to have a datarepeater with radiobuttons but for some reason (suppose there are 10 rows) only the first row has a radiobutton and none other Thanks, Stephen
1
1532
by: Stephen | last post by:
Hi, I have a quick question. I am displaying all the orders that are active. I am making use of a datarepeater with checkboxes to display data and a submit button to insert into the database. suppose i want to make the orders inactive using the checkboxes and click on the submit button should update the database. How do I capture the event such that only those check boxes that have been
2
6371
by: Arsalan | last post by:
What is the equivalent of DataRepeater control in VB.NET ?
12
5323
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
1
2534
by: =?Utf-8?B?QW1qYWQ=?= | last post by:
Hi i have datarepeater in which i have textboxes, how to create txtCustID_TextChanged event in datarepeater like simple textbox its easy double click it and it create automatically the event but in data repeater we have multiple textbox and cannot directly create event handler for that textbox has repeated several time.
2
2165
by: Tony K | last post by:
I downloaded the new VB PowerPack 3.0 and began using the DataRepeater. I have 2 DateTimePickers, current and future. When I add a new item, to the datarepeater, I want to automatically add 1 year to the future DateTimePicker. The DataRepeater contains fields from the Service table of my DataSet. Here is my code. Try Me.DataRepeater1.AddNew()
0
8445
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8640
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.