Skip to content

Commit a944834

Browse files
Merge pull request #2 from subaa1492/master
Added List data code
2 parents 209c97c + 50ad7dc commit a944834

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Pages/Index.razor

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
CrossDomain=true >
1515
</EjsDataManager>
1616
</EjsDropDownList>
17+
18+
// List data binding
19+
@* <EjsDropDownList DataSource="@Games" TValue="string" TItem="GamesData" Placeholder="Select a game"
20+
PopupWidth="250px" PopupHeight="400px">
21+
<DropDownListFieldSettings Text="Name" Value="ID">
22+
</DropDownListFieldSettings>
23+
</EjsDropDownList> *@
1724
</div>
1825

1926
<style>
@@ -24,10 +31,28 @@
2431
</style>
2532

2633
@code {
27-
public class EmployeeData {
34+
35+
public class EmployeeData {
2836
public string FirstName { get; set; }
2937
public string EmployeeID { get; set; }
3038
public string Designation { get; set; }
3139
public string Country { get; set; }
3240
}
33-
}
41+
42+
// Model class for List data source
43+
@* public class GamesData
44+
{
45+
public string ID { get; set; }
46+
public string Name { get; set; }
47+
}
48+
List<GamesData> Games = new List<GamesData> {
49+
new GamesData() { ID= "Game1", Name= "Badminton" },
50+
new GamesData() { ID= "Game2", Name= "Basketball" },
51+
new GamesData() { ID= "Game3", Name= "Cricket" },
52+
new GamesData() { ID= "Game4", Name= "Football" },
53+
new GamesData() { ID= "Game5", Name= "Golf" },
54+
new GamesData() { ID= "Game6", Name= "Hockey" },
55+
new GamesData() { ID= "Game7", Name= "Tennis"},
56+
}; *@
57+
58+
}

0 commit comments

Comments
 (0)