This is a migrated thread and some comments may be shown as answers.
radgrid with objectdatasource
1 Answer 134 Views
This is a migrated thread and some comments may be shown as answers.
Judith
Top achievements
Rank 1
Judith asked on 06 Jan 2009, 04:26 PM
I am trying to make the radgrid work using an objectdatasource as the datasource for the radgrid. I saw in different posts that in order for the radgrid to do sorting and updating with objects, the class has to implement the Ienumerable interface. The code for my business object is 

Public

 

Class IngredientSource

 

 

Private _ID As Integer

 

 

Private _CompanyID As String

 

 

Private _CompanyName As String

 

 

Private _AddlCompanyName As String

 

 

Private _EntryDate As DateTime

 

 

Private _Comment As String

 

 

Private _AgencyID As Integer

 

 

Private _AgencyName As String

 

 

Private _RenewalMonth As String

 

 

 

 

Public Property ID() As Integer

 

 

Get

 

 

Return _ID

 

 

End Get

 

 

Set(ByVal value As Integer)

 

_ID = value

 

End Set

 

 

End Property

 

 

Public Property CompanyName() As String

 

 

Get

 

 

Return _CompanyName

 

 

End Get

 

 

Set(ByVal value As String)

 

_CompanyName = value

 

End Set

 

 

End Property

 

 

Public Property AddlCompanyName() As String

 

 

Get

 

 

Return _AddlCompanyName

 

 

End Get

 

 

Set(ByVal value As String)

 

_AddlCompanyName = value

 

End Set

 

 

End Property

 

 

Public Property EntryDate() As DateTime

 

 

Get

 

 

Return _EntryDate

 

 

End Get

 

 

Set(ByVal value As DateTime)

 

_EntryDate = value

 

End Set

 

 

End Property

 

 

Public Property Comment() As String

 

 

Get

 

 

Return _Comment

 

 

End Get

 

 

Set(ByVal value As String)

 

_Comment = value

 

End Set

 

 

End Property

 

 

Public Property AgencyID() As Integer

 

 

Get

 

 

Return _AgencyID

 

 

End Get

 

 

Set(ByVal value As Integer)

 

_AgencyID = value

 

End Set

 

 

End Property

 

 

Public Property AgencyName() As String

 

 

Get

 

 

Return _AgencyName

 

 

End Get

 

 

Set(ByVal value As String)

 

_AgencyName = value

 

End Set

 

 

End Property

 

 

Public Property RenewalMonth() As String

 

 

Get

 

 

Return _RenewalMonth

 

 

End Get

 

 

Set(ByVal value As String)

 

_RenewalMonth = value

 

End Set

 

 

End Property

 

 

Public ReadOnly Property FullName() As String

 

 

Get

 

 

Return Trim(_CompanyName) + ", " + Trim(_AddlCompanyName)

 

 

End Get

 

 

End Property

 

End

 

Class

 

 

Public

 

Class IngredientSourceList

 

 

Inherits List(Of IngredientSource)

 

 

Public Sub New()

 

 

End Sub

 

End

 

Class

How would I implement Ienumerable with this class and does the IngredientSourceList use Ienumberable by using   List(of)

Thank you . I am a newbie at vb.net

Judith

 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 09 Jan 2009, 05:09 PM
Hello Judith,

You can find information and demos on how to use RadGrid bound via ObjectDataSource on the following links:
Automatic DataSource operations
Automatic operations with ObjectDataSource control

Greetings,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Judith
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or