StrataFrame Forum

New C# Component

http://forum.strataframe.net/Topic16113.aspx

By Bill Cunnien - 5/3/2008

I have seen the design of a VB component that inherits from BusinessBindingSource; however, I cannot see to create a C# component that does the same thing (my VB to C# translation skills are not always up to par).  My goal is to create an extended component for a specific business object.  The XBBS will be dropped onto an XtraReport as a datasource.  Any pointers would be appreciated?

Bill

By Bill Cunnien - 5/3/2008

After adding a new component to the project, I altered the code to look like this:

using Aspire.Model;
using MicroFour.StrataFrame.Business;
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

namespace Aspire.Shipping.Datasources
{
   
public partial class PackingListDS : BusinessBindingSource
   
{
       
public PackingListDS()
        {
            InitializeComponent();
           
this.BusinessObject = new PackingListBO();
        }
       
public PackingListDS(IContainer container)
        {
            container.Add(
this);
            InitializeComponent();
        }
    }
}

I did nothing to the designer.cs file.  Is this correct?  How do I get the component added to the toolbox?

Thanks,
Bill

By Bill Cunnien - 5/3/2008

The catch...close the solution.  Then, reopen it and add the item manually to the appropriate tab in the toolbox.

So far, so good...now, on to the report.

By Trent L. Taylor - 5/5/2008

Yup...you got it figured out.  Looks good Smile