G
Guest
i am new to generics so...
if i have say
dim MySecondList as new BindingList (Of MyFirstThing)
dim MyFirstList as new BindingList (Of MySecondThing)
how can i instantiate a new item withing the list without knowing what Type
to create?
so i might have
sub Dostuff( bl as BindingList)
'create a new item in the bindinglist
i want to be able to say something like
bl.AddNewItem
and have the binding list instantiate the right sort of item and add it
to the list
so that if the list is MyFirstList it adds a new MyFirstThing
but if it is a MySecondList it adds a new MySecondThing
end sub
how do i do that?
thanks guy
if i have say
dim MySecondList as new BindingList (Of MyFirstThing)
dim MyFirstList as new BindingList (Of MySecondThing)
how can i instantiate a new item withing the list without knowing what Type
to create?
so i might have
sub Dostuff( bl as BindingList)
'create a new item in the bindinglist
i want to be able to say something like
bl.AddNewItem
and have the binding list instantiate the right sort of item and add it
to the list
so that if the list is MyFirstList it adds a new MyFirstThing
but if it is a MySecondList it adds a new MySecondThing
end sub
how do i do that?
thanks guy