@@ -29,56 +29,7 @@ The Telerik Blazor grid is built on native Blazor from the ground up, by a compa
29
29
30
30
> caption Get started with the Blazor Grid
31
31
32
- ```` RAZOR
33
- @* Telerik Blazor Grid with some common features *@
34
-
35
- <TelerikGrid Data="@GridData"
36
- Pageable="true"
37
- Sortable="true"
38
- FilterMode="@GridFilterMode.FilterRow">
39
- <GridColumns>
40
- <GridColumn Field="Name" Title="Product Name" />
41
- <GridColumn Field="Price" DisplayFormat="{0:C2}" />
42
- <GridColumn Field="@nameof(Product.Released)" DisplayFormat="{0:D}" />
43
- <GridColumn Field="@nameof(Product.Discontinued)" />
44
- </GridColumns>
45
- </TelerikGrid>
46
-
47
- @code {
48
- private List<Product> GridData { get; set; }
49
-
50
- protected override void OnInitialized()
51
- {
52
- GridData = new List<Product>();
53
-
54
- var rnd = new Random();
55
-
56
- for (int i = 1; i <= 30; i++)
57
- {
58
- GridData.Add(new Product
59
- {
60
- Id = i,
61
- Name = "Product name " + i,
62
- Price = (decimal)(rnd.Next(1, 50) * 3.14),
63
- Released = DateTime.Now.AddDays(-rnd.Next(1, 365)).AddYears(-rnd.Next(1, 10)).Date,
64
- Discontinued = i % 5 == 0
65
- });
66
-
67
- }
68
-
69
- base.OnInitialized();
70
- }
71
-
72
- public class Product
73
- {
74
- public int Id { get; set; }
75
- public string Name { get; set; }
76
- public decimal Price { get; set; }
77
- public DateTime Released { get; set; }
78
- public bool Discontinued { get; set; }
79
- }
80
- }
81
- ````
32
+ <demo metaUrl =" client/grid/overview/ " height =" 555 " ></demo >
82
33
83
34
## Blazor Grid Video Tutorial
84
35
@@ -186,41 +137,7 @@ To execute these methods, obtain reference to the Grid instance via `@ref`.
186
137
187
138
> caption How to obtain a Grid reference and call methods
188
139
189
- ```` RAZOR
190
- <TelerikButton OnClick="@AutoFit">Autofit All Columns</TelerikButton>
191
-
192
- <TelerikGrid @ref="TheGrid"
193
- Data="@GridData"
194
- Width="600px">
195
- <GridColumns>
196
- <GridColumn Field="@(nameof(GridModel.Id))" />
197
- <GridColumn Field="@(nameof(GridModel.Text))" Width="300px" />
198
- </GridColumns>
199
- </TelerikGrid>
200
-
201
- @code {
202
- private TelerikGrid<GridModel> TheGrid { get; set; }
203
-
204
- private async Task AutoFit()
205
- {
206
- await TheGrid.AutoFitAllColumnsAsync();
207
- }
208
-
209
- private IEnumerable<GridModel> GridData = Enumerable.Range(1, 5)
210
- .Select(x => new GridModel
211
- {
212
- Id = x,
213
- Text = "some longer text here that will not fit on a single line and we would like to expand it " + x
214
- });
215
-
216
- public class GridModel
217
- {
218
- public int Id { get; set; }
219
- public string Text { get; set; }
220
- }
221
- }
222
- ````
223
-
140
+ <demo metaUrl =" client/grid/overview-ref/ " height =" 450 " ></demo >
224
141
225
142
## Next Steps
226
143
0 commit comments