Skip to content

Commit 9795684

Browse files
committed
docs(grid): add VB code snippet
1 parent f35f6bd commit 9795684

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

controls/grid/overview.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,25 @@ public class SampleData
9999
public DateTime HireDate { get; set; }
100100
}
101101
````
102+
````VB
103+
Protected Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs)
104+
TryCast(sender, RadGrid).DataSource = MyData
105+
End Sub
106+
107+
Public MyData As IEnumerable(Of SampleData) = Enumerable.Range(1, 30).[Select](Function(x) New SampleData With {
108+
.Id = x,
109+
.Name = "Name " & x,
110+
.Team = "Team " & x Mod 5,
111+
.HireDate = DateTime.Now.AddDays(-x * 3).Date
112+
})
113+
114+
Public Class SampleData
115+
Public Property Id As Integer
116+
Public Property Name As String
117+
Public Property Team As String
118+
Public Property HireDate As DateTime
119+
End Class
120+
````
102121

103122
The result from the code snippet above
104123
![Basic RadGrid Example](images/grid-overview-basic-create.png)

0 commit comments

Comments
 (0)