Design-time Databinding Question

Posts   
 
    
FredL
User
Posts: 5
Joined: 29-Jun-2005
# Posted on: 30-Jun-2005 23:19:23   

Hi,

I am trying to do design-time data binding to a custom control I have developed. I have an entity called PropertyPage and there are five PropertyPage entities in the PropertyPage set.

When I do a design-time binding of a PropertyPage field called PpPageTitle, Visual Studio inserts the following binding expression:

DataBinder.Eval(propertyPageCollection1, "[0].PpPageTitle")

When I run the web application, I get the following error:

Specified argument was out of the range of valid values. Parameter name: Index was out of range. Must be non-negative and less than the size of the collection.

My assumption is that it will return the PpPageTitle field of the first entity in the collection. Am I wrong? Am I correct in assuming that I can bind a single field from a single entity in the PropertyPageCollection to a field in my control? If so, can you please give me some direction?

If I have missed something basic in the documentation I apologize.

Thanks for your help.

FredL
User
Posts: 5
Joined: 29-Jun-2005
# Posted on: 01-Jul-2005 00:36:50   

I went back and read the documentation again and answered my own question.

"you only have to add the calls to the GetMulti() method to fill the form with data at runtime"

Sorry...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 01-Jul-2005 08:57:42   

Glad it's solved! simple_smile

Frans Bouma | Lead developer LLBLGen Pro