Hi buddies!
I'm facing a little problem with the RadGrid control.
I've got a simple RadGrid:
When i use this code eveything works and the data is well displayed :
But when i try to use a custom class (Acontact) this is the class :
i try this, but the grid stays empty:
Does anybody have an idea? Thanks a lot..
Nicolas
I'm facing a little problem with the RadGrid control.
I've got a simple RadGrid:
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"> |
</telerik:RadGrid> |
When i use this code eveything works and the data is well displayed :
Protected Sub RadGrid1_NeedDataSource(ByVal [source] As Object, _ |
ByVal e As GridNeedDataSourceEventArgs) _ |
Handles RadGrid1.NeedDataSource |
Dim list As New ArrayList |
list.Add("string1") |
list.Add("string2") |
list.Add("string3") |
RadGrid1.DataSource = list |
End Sub |
Public Class AContact |
Private _name As String |
Private _email As String |
Public Property Name() As String |
Get |
Return _name |
End Get |
Set(ByVal value As String) |
_name = Name |
End Set |
End Property |
Public Property Email() As String |
Get |
Return _email |
End Get |
Set(ByVal value As String) |
_email = Email |
End Set |
End Property |
End Class |
i try this, but the grid stays empty:
Protected Sub RadGrid1_NeedDataSource(ByVal [source] As Object, _ |
ByVal e As GridNeedDataSourceEventArgs) _ |
Handles RadGrid1.NeedDataSource |
Dim maListe As New List(Of SABerni.Gateway.AContact) |
Dim Contact1 As New SABerni.Gateway.AContact |
Contact1.Name = "demo" |
Contact1.Email = "emaildemo" |
maListe.Add(Contact1) |
RadGrid1.DataSource = maListe |
End Sub |
Does anybody have an idea? Thanks a lot..
Nicolas