ObjectContainerDataSource.Insert?

Topics: Web Client Software Factory, User Forum
Sep 4, 2007 at 10:15 AM
Hi guys,

I would like to manually (not through a DataboundControl) insert an item into a ObjectContainerDataSource but I don't find the correct way to do it.
ObjectDataSource owns a Insert method (which is just a wrapper to his view's method) but objectcontainer does not.
Any idea?

Greets,
Stéphane Bebrone.
Sep 6, 2007 at 5:06 PM
Edited Sep 6, 2007 at 5:27 PM
Hi Stéphane!

ObjectContainerDataSource don’t have a Insert or Add method.
A possible solution, although it´s not the best, would be to set the ObjectContainerDataSource.DataSource every time that you insert a new item:

IList<Customer> Customers = GetAllCustomers();
Customers.Add(new Customer("John", "Doe"));            //Add a new customer
CustomersObjectContainerDataSource.DataSource = Customers;

For more information, you can read the following topic from the WCSF documentation:
  • How to: Use the ObjectContainerDataSource Control (Developing Web Client Applications -> How to: Use the ObjectContainerDataSource Control)

Sebastian Iacomuzzi
http://staff.southworks.net/blogs/siacomuzzi