Link to home
Start Free TrialLog in
Avatar of Soluga
Soluga

asked on

C# IList conversion from VB

I am trying to conver my vb code below to C#. But I get the error "Using the gerneric type system.collections.generic.IList<T> requires 1 type arguments" where the iList is declared in the declaration.

Would be grateful for any help.

Thanks

Public Function CreateGrid(ByVal id As String,
                   ByVal allowGrouping As Boolean,
                   ByVal allowFiltering As Boolean,
                   ByVal showFooter As Boolean,
                   ByVal allowAddingRecords As Boolean,
                   ByVal autoGenerateColumns As Boolean,
                   ByVal pageSize As Integer,
                   ByVal showHeader As Boolean,
                   ByVal dataSource As IList) As Grid

C# Conversion.......

public Grid CreateGrid(string id, bool allowGrouping, bool allowFiltering, bool showFooter, bool allowAddingRecords, bool autoGenerateColumns, int pageSize, bool showHeader, IList dataSource)
Avatar of strickdd
strickdd
Flag of United States of America image

This is it without knowing your data type:

public Grid CreateGrid(string id, bool allowGrouping, bool allowFiltering, bool showFooter, bool allowAddingRecords, bool autoGenerateColumns, int pageSize, bool showHeader, IList<DATATYPEHERE> dataSource) 

Open in new window


This is it assuming your data type:

public Grid CreateGrid(string id, bool allowGrouping, bool allowFiltering, bool showFooter, bool allowAddingRecords, bool autoGenerateColumns, int pageSize, bool showHeader, IList<ObjectDataSource> dataSource) 

Open in new window

Avatar of Soluga
Soluga

ASKER

My datasource is a generic list!
Avatar of Soluga

ASKER

Would this work...

using System.Collections;

          public Grid CreateGrid(string id, bool allowGrouping, bool allowFiltering, bool showFooter, bool allowAddingRecords, bool autoGenerateColumns, int pageSize, bool showHeader, IList<ICollection> dataSource)
ASKER CERTIFIED SOLUTION
Avatar of strickdd
strickdd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Soluga

ASKER

OK,
Thats great thanks.