my setup is a bit more complex as I use the grid control in an ASP.net UserControl which stores the data in a session variable like this.
Public Property ViewSource() As System.Data.DataView
Get
If m_ViewSource Is Nothing Then
m_ViewSource = CType(Session(Me.UniqueID), Data.DataView)
End If
Return Me.m_ViewSource
End Get
Set(ByVal Value As System.Data.DataView)
Session.Add(Me.UniqueID, Value)
m_ViewSource = Value
End Set
End Property
Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
Me.RadGrid1.DataSource = Me.ViewSource
End Sub
The grid is populated like this:
Public Sub LoadView(ByVal viewtable As DataTable)
Try
Dim view As New Data.DataView
view.Table = viewtable
Me.ViewSource = view
Me.RadGrid1.DataSource = Me.ViewSource
Me.RadGrid1.Rebind()
Catch ex As Exception
RaiseEvent ErrorEvent(Me, New ErrorEventArgs(ex))
End Try
End Sub
Any help would be highly appreciated