M
Mike Surcouf
Hi All
I have a stored procedure wrapper that returns Collection<T>.
The wrapper is generated by codesmith so I don't really want to start
altering it.
I need to use this collection in a datagridview.
I would like the ability to add to this collection or delete from this
collection using the grid.
I know I will need to use Bindinglist<T> for this but I don't seem to be
able to cast from
collection<T> to bindinglist<T>
Sample Code
gridRows = (BindingList<SalesInvoiceListCompassSelectRow>)rows;
Error I get is
Unable to cast object of type
'System.Collections.ObjectModel.Collection`1[CompassEdi.SalesInvoiceListCompassSelectRow]'
to type
'System.ComponentModel.BindingList`1[CompassEdi.SalesInvoiceListCompassSelectRow]'.
Maybe I have to iterate through Collection<T> and add to BindingList<T>.
Or maybe someone has an easier way
Many Thanks
Mike
I have a stored procedure wrapper that returns Collection<T>.
The wrapper is generated by codesmith so I don't really want to start
altering it.
I need to use this collection in a datagridview.
I would like the ability to add to this collection or delete from this
collection using the grid.
I know I will need to use Bindinglist<T> for this but I don't seem to be
able to cast from
collection<T> to bindinglist<T>
Sample Code
gridRows = (BindingList<SalesInvoiceListCompassSelectRow>)rows;
Error I get is
Unable to cast object of type
'System.Collections.ObjectModel.Collection`1[CompassEdi.SalesInvoiceListCompassSelectRow]'
to type
'System.ComponentModel.BindingList`1[CompassEdi.SalesInvoiceListCompassSelectRow]'.
Maybe I have to iterate through Collection<T> and add to BindingList<T>.
Or maybe someone has an easier way
Many Thanks
Mike