Databind GridView ASP.NET 2.0

Posts   
 
    
billb
User
Posts: 50
Joined: 09-Jul-2004
# Posted on: 22-Nov-2004 18:11:42   

I know this is a beta product and I don't expect it to be supported, but I was just wondering if anyone has attempted to bind an EntityCollection or TypedList to the new GridView. I attempted to set the DataSource to the collection (and typed list) and call DataBind(), but my grid is empty. Is there something I'm missing or is this just not supported?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 22-Nov-2004 18:32:24   

It should work I think, but perhaps it doesn't create columns for you automatically ?

Frans Bouma | Lead developer LLBLGen Pro
billb
User
Posts: 50
Joined: 09-Jul-2004
# Posted on: 22-Nov-2004 20:02:35   

Otis wrote:

It should work I think, but perhaps it doesn't create columns for you automatically ?

Maybe that's the case. I'm not sure. I did tell it to auto create the columns. I'll try adding them manually and see what happens.

Thanks.

billb
User
Posts: 50
Joined: 09-Jul-2004
# Posted on: 23-Nov-2004 16:25:18   

Bleh ... well, I tried to bind the control to a plain old ArrayList and that didn't work either. confused

billb wrote:

Otis wrote:

It should work I think, but perhaps it doesn't create columns for you automatically ?

Maybe that's the case. I'm not sure. I did tell it to auto create the columns. I'll try adding them manually and see what happens.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 23-Nov-2004 18:51:51   

Perhaps they decided in all their wisdom that controls have to implement only that new interface IObjectDatasource or something? (which is weird, but you never know wink )

Frans Bouma | Lead developer LLBLGen Pro
billb
User
Posts: 50
Joined: 09-Jul-2004
# Posted on: 28-Nov-2004 01:41:59   

No, something went very wrong. I ended up deleting the grid and tried to bind my ArrayList (which worked), then I binded an EntityCollection and that worked as well. Strange.

Now to figure out how to bind a collection to a DropDownList that's embedded inside of a GridView.

Otis wrote:

Perhaps they decided in all their wisdom that controls have to implement only that new interface IObjectDatasource or something? (which is weird, but you never know wink )