Posts   
 
    
softwarea
User
Posts: 57
Joined: 05-Mar-2007
# Posted on: 05-Mar-2007 16:58:46   

Hi, I'm new to LLBLGen, but already fascinated by it's powerful features. Unfortunately I'm new to ASP.NET too, so I have a question concerning datasources and the IList...

Using Microsofts standard gridView I had no problem in binding an entity collection to such a grid.

    CustomerCollection customers = new CustomerCollection();
    customers.GetMulti(null);

    gridView.DataSource = customers;
    gridView.DataBind();

However, I have to use ComponentArt's grid component for my current project. And the approach above does not work for this component (exception occurs on DataBind()). Of course I realize that you can't give me support for ComponentArts components, but I figured out that there grid control supports any DataSource that supports the "IList" interface.

So this is my question: Is there any way to generate or convert an IList compatible entity collection with LLBL's means?

Any help on this would we really great! Thanks very much, Ingmar

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 05-Mar-2007 17:12:19   

Hi,

try using yourCollection.DefaultView or equivalently yourCollection.GetList()

cheers

softwarea
User
Posts: 57
Joined: 05-Mar-2007
# Posted on: 06-Mar-2007 06:26:01   

Hello Jessynoo,

thanks very much for your suggestion. And yes, it works...almost ;-) At least I do not get an error message anymore.

But the grid is almost invisible, I can only see the pager (however, which in fact already shows the correct number of datarows that I would expect).

So, I think I will have to do some more researches at ComponentArts.

Thanks again! Ingmar

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Mar-2007 06:33:30   

If that's ASP.NET 2.0, you ca also try to use LLBLGenProDataSource to be the middle man between the grid and the collection. Check the manual "Using the generated code -> SelfServicing -> Databinding at design time and at runtime -> Databinding with ASP.NET 2.0"

softwarea
User
Posts: 57
Joined: 05-Mar-2007
# Posted on: 06-Mar-2007 06:50:43   

Hello Walaa,

yes I forgot to mention that I already tried that too. I was using the selfservice's LLBLGenProDataSource with both container types "EntityCollection" and "TypedView". but it does not make any difference.

Looking at ComponentArts examples for binding an ObjectDataSource, I think they are using an **ArrayList **to populate the grid.

Does ArrayList implement the IList interface? Or is there an easy way to produce an ArrayList from an LLBL entity collection?

Sorry for asking so stupid things, but right now I still miss the woods for the trees...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Mar-2007 08:21:32   

As far as I remember ArrayList does implement IList and ICollection

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 06-Mar-2007 11:22:12   

Well, to give you proper advice: drop the componentart's grid. They have implemented hardcoded databinding to datasourcecontrols in the .NET framework but were too stupid to simply target the datasource control base class so ALL datasourcecontrol's work.

Though, the binding you provided in the startpost should simply work. What kind of error did you get?

Frans Bouma | Lead developer LLBLGen Pro
softwarea
User
Posts: 57
Joined: 05-Mar-2007
# Posted on: 06-Mar-2007 11:35:56   

Hello Otis,

thanks for your reply too. Well, after some changes in the grid's configuration I do not get an error message any more, but I do not see any grid either. However I can see the column headers and the pager. And the pager displays the correct amount of rows (identical to the amount of entities in the collection).

Allright, you think I should drop the ComponentArt grid. I already did ;-) Right now I'm trying "obout". But problems again. I'm already in contact with those guys.

Unfortunately no grid I tried yet works together with LLBLGen (without superior knowledge). Only MS standard grid... ;-)

But let's turn the thing around: Do YOU have any suggestions for a powerful grid component that obviously has no problems with LLBL collections?

Thanks! Ingmar

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 06-Mar-2007 11:54:51   

Did you define any columns in the grid? If you did this by hand, are you sure the names match so you have no casing problems (I.e. CustomerID vs. CustomerId) ?

Telerik's grid or deveexpress' grid. There are others which are ok, just that componentart's one is really not that bright.

Frans Bouma | Lead developer LLBLGen Pro
softwarea
User
Posts: 57
Joined: 05-Mar-2007
# Posted on: 06-Mar-2007 12:57:14   

No, just to go sure, I did not define any columns. I really tried to avoid any special settings. Just an entity collection and a grid with default settings.

Ok, I tried telerik a few days ago. But there grid seemed way slow to me. Maybe I did (again ;-) something wrong. I will try DevExpress now. Thanks for the tipps!