Spread ASP.NET 17
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread.Model Namespace / DefaultSheetDataModel Class / DefaultSheetDataModel Constructor / DefaultSheetDataModel Constructor(IListSource,Type)
Data source to be used
Element type in the data source
Example


In This Topic
    DefaultSheetDataModel Constructor(IListSource,Type)
    In This Topic
    Creates a default data model with the specified data set (IListSource object).
    Syntax
    'Declaration
     
    
    Public Function New( _
       ByVal dataSource As IListSource, _
       ByVal itemType As Type _
    )
    'Usage
     
    
    Dim dataSource As IListSource
    Dim itemType As Type
     
    Dim instance As New DefaultSheetDataModel(dataSource, itemType)
    public DefaultSheetDataModel( 
       IListSource dataSource,
       Type itemType
    )

    Parameters

    dataSource
    Data source to be used
    itemType
    Element type in the data source
    Remarks
    For more information about the IListSource class, see the Microsoft .NET Framework Reference.
    Example
    This example creates a new default data model, binds it to an IList (in this case an array) in its constructor and attaches it to the DataModel of the active sheet.
    Dim values As ArrayList = New ArrayList()
    values.Add("SpreadWebv2")
    values.Add("InputProforWinForms")
    Dim t As Type=values.GetType()
    Dim dm As New FarPoint.Web.Spread.Model.DefaultSheetDataModel(values,GetType(String))
    FpSpread1.ActiveSheetView.DataModel=dm
    ArrayList values= new ArrayList();
    values.Add("SpreadWebv2");
    values.Add("InputProforWinForms");
    Type t = values.GetType();
    FarPoint.Web.Spread.Model.DefaultSheetDataModel dm =new FarPoint.Web.Spread.Model.DefaultSheetDataModel(values,typeof(string));
    FpSpread1.ActiveSheetView.DataModel=dm;
    See Also