Migration to NET 2.0

Posts   
 
    
hplloyd
User
Posts: 191
Joined: 29-Oct-2004
# Posted on: 11-Oct-2006 15:54:30   

Hi,

I have the following code that works perfectly to bind a collection to a Janus grid in a NET1.1 project using LLBL 2.0 code

public IEntityCollection2 CTLDataSource
        {
            set
            {
                if (value != null)
                {
                    EntityView2 source = new EntityView2(value);
                    mobjGridSource=source;
                    this.DataSource=mobjGridSource;
                    CTLRefetch();
                }
            }
        }

As you c an see the code takes a collection, creates an EntityView from this and binds the EntityView to the grid because the EntityView implements IBindingList

I am now trying to migrate my code to NET2.0 but this code is no longer valid because I need to use type arguments. I get the following error

Using the generic type 'SD.LLBLGen.Pro.ORMSupportClasses.EntityView2<TEntity>' requires '1' type arguments

How do I adjust this code so that I accepts a collection of any entity type, converts it to the corresponding EntityView2 and binds that to the grid?

Many thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-Oct-2006 16:13:22   

EntityView2 source = value.DefaultView;