Re: Business objects with no properties and data binding
Efran Cobisi <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Organization | QBGROUP SpA |
| Message-ID | <[email protected]> |
Hi,
Afaik this is not possible, because bound values are gathered using the
System.Web.UI.DataBinder:GetDataItem() method, which expects public
properties.
You could, however, write a proxy for your object, which could abstract
the logic required to access data in your object, allowing to retrieve
using public properties.
HTH,
Efran Cobisi
http://www.cobisi.com
Alex Ivanoff wrote:
> Is it possible to data bind a web control (DropDownList) to a list of
> business objects which do not have properties but accessor methods instead:
>
> public class State
> {
> private String _abbr;
> private String _name;
>
> public String GetAbbr()
> {
> return this._abbr;
> }
>
> public String GetName()
> {
> return this._name;
> }
> }
>
> Thank you,
> Alex
>
> ===================================
> This list is hosted by DevelopMentor® http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com