radgrid with objectdatasource

2 posts, 0 answers
  1. Judith
    Judith avatar
    14 posts
    Member since:
    Aug 2007

    Posted 06 Jan 2009 Link to this post

    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

     

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 09 Jan 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top