We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Adding an object programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

6126 Jul 31,2003 08:23 PM Aug 1,2003 04:16 AM Windows Forms 2
loading
Tags: GridControl
Laurie Spencer
Asked On July 31, 2003 08:23 PM

I must be missing something here. I have a GridDataBoundGrid class (DocumentGrid) with a class (DocumentList) derived from ArrayList as a data source. DocumentList implements IBindingList. I would now like to programmatically add an existing object (Document)to DocumentList and have it show up in the grid. AddNew does not seem to be the way to go since you can't pass it the Document as a parameter. Any ideas? Thanks! Laurie

Administrator [Syncfusion]
Replied On August 1, 2003 02:02 AM

> I must be missing something here. I have a GridDataBoundGrid class (DocumentGrid) with a class (DocumentList) derived from ArrayList as a data source. DocumentList implements IBindingList. I would now like to programmatically add an existing object (Document)to DocumentList and have it show up in the grid. AddNew does not seem to be the way to go since you can't pass it the Document as a parameter. > > Any ideas? > > Thanks! > Laurie > What does your implementation of IBindingList.AddNew do? Normally, it would create a new object of the proper type and add it to the IBindingList.List, firing the proper notification events along the way. You can see a sample implementation in the \Syncfusion\Essential Suite\Grid\Samples\DataBound\Hierarchical\Customers sample. Once the default new item is in your collection, you could then replace it in your list with your existing object.

Administrator [Syncfusion]
Replied On August 1, 2003 04:16 AM

You could add a new public AddNew method with a different signature, and pass it the existing object so it can be directly added to your list. This new method should make sure the proper ListChanged event is fired. Then you could use this method directly from code to add your existing object.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;