This is a migrated thread and some comments may be shown as answers.

[Solved] vb.net radgrid tutorial not working

1 Answer 112 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jtby
Top achievements
Rank 1
jtby asked on 08 Jul 2009, 04:26 PM

 

I am trying out radgrid silverlight control.  From Help I choose Controls->RadGridView->Tutorial->Getting Started, and copy and paste the code there into my project.  However code fails at the highlighted line below with Too many arguments to 'Public Sub New()'

Private
Function GetObservableObjectData() As ObservableCollection(Of Customer)

 

 

    Return New ObservableCollection(Of Customer)(GetData())

 

 

End Function

... is it a problem in the documentation?  I have copied the code exactly.

 

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 09 Jul 2009, 07:35 AM
Hello jtby,

Thank you for pointing this out. Indeed, there is a mistake in the documentation, which we will correct right away. The error is due to the fact that in Silverlight the ObservableCollection(Of T) class does not have a constructor accepting an IEnumerable(Of T). We will correct the code snippet so it works in both Silverlight and WPF.

The correct code you should use is:

    Private Function GetObservableObjectData() As ObservableCollection(Of Customer) 
        Dim data As New ObservableCollection(Of Customer)() 
        For Each customer As Customer In data 
            data.Add(customer) 
        Next 
        Return data 
    End Function 
 

I hope this helps. Please, excuse us for the inconvenience.

Kind regards,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
jtby
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or