Skip to content

Commit 3049335

Browse files
Migrated all projects to latest TFM and Updated NuGet Packages
1 parent 3a84224 commit 3049335

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1342
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<table>
2+
<tr>
3+
<td><a href="BindValue">BindValue</a></td>
4+
<td><a href="IndexValueBinding">IndexValueBinding</a></td>
5+
</tr>
6+
</table>
7+
8+
9+
<style>
10+
a {
11+
padding-right: 75px;
12+
}
13+
</style>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@page "/BindValue"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
<BindRoute></BindRoute>
5+
6+
<p>DropDownList value is:<strong>@DropVal</strong></p>
7+
8+
<SfDropDownList TValue="string" Placeholder="e.g. Australia" TItem="Country" @bind-Value="@DropVal" DataSource="@Countries">
9+
<DropDownListFieldSettings Value="Name"></DropDownListFieldSettings>
10+
</SfDropDownList>
11+
12+
@code {
13+
14+
public string DropVal;
15+
16+
public class Country
17+
{
18+
public string Name { get; set; }
19+
20+
public string Code { get; set; }
21+
}
22+
23+
List<Country> Countries = new List<Country>
24+
{
25+
new Country() { Name = "Australia", Code = "AU" },
26+
new Country() { Name = "Bermuda", Code = "BM" },
27+
new Country() { Name = "Canada", Code = "CA" },
28+
new Country() { Name = "Cameroon", Code = "CM" },
29+
};
30+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@page "/IndexValueBinding"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
<BindRoute></BindRoute>
5+
6+
<SfAutoComplete TValue="string" Placeholder="e.g. Australia" TItem="Country" @bind-Index="@ddlIndex" DataSource="@Countries">
7+
<AutoCompleteFieldSettings Value="Name"></AutoCompleteFieldSettings>
8+
</SfAutoComplete>
9+
10+
@code {
11+
12+
private int? ddlIndex { get; set; } = 1;
13+
14+
public class Country
15+
{
16+
public string Name { get; set; }
17+
18+
public string Code { get; set; }
19+
}
20+
21+
List<Country> Countries = new List<Country>
22+
{
23+
new Country() { Name = "Australia", Code = "AU" },
24+
new Country() { Name = "Bermuda", Code = "BM" },
25+
new Country() { Name = "Canada", Code = "CA" },
26+
new Country() { Name = "Cameroon", Code = "CM" },
27+
};
28+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@page "/ArrayOfComplexData"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
<SourceRoute></SourceRoute>
5+
6+
<SfDropDownList TValue="string" TItem="Complex" Placeholder="e.g. Select a country" DataSource="@LocalData">
7+
<DropDownListFieldSettings Text="Country.CountryID" Value="Code.ID"></DropDownListFieldSettings>
8+
</SfDropDownList>
9+
10+
@code {
11+
12+
public IEnumerable<Complex> LocalData { get; set; } = new Complex().GetData();
13+
14+
public class Code
15+
{
16+
public string ID { get; set; }
17+
}
18+
19+
public class Country
20+
{
21+
public string CountryID { get; set; }
22+
}
23+
24+
public class Complex
25+
{
26+
public Country Country { get; set; }
27+
public Code Code { get; set; }
28+
public List<Complex> GetData()
29+
{
30+
List<Complex> Data = new List<Complex>();
31+
Data.Add(new Complex() { Country = new Country() { CountryID = "Australia" }, Code = new Code() { ID = "AU" } });
32+
Data.Add(new Complex() { Country = new Country() { CountryID = "Bermuda" }, Code = new Code() { ID = "BM" } });
33+
Data.Add(new Complex() { Country = new Country() { CountryID = "Canada" }, Code = new Code() { ID = "CA" } });
34+
Data.Add(new Complex() { Country = new Country() { CountryID = "Cameroon" }, Code = new Code() { ID = "CM" } });
35+
Data.Add(new Complex() { Country = new Country() { CountryID = "Denmark" }, Code = new Code() { ID = "DK" } });
36+
Data.Add(new Complex() { Country = new Country() { CountryID = "France" }, Code = new Code() { ID = "FR" } });
37+
return Data;
38+
}
39+
}
40+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@page "/ArrayOfJSONData"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
<SourceRoute></SourceRoute>
5+
6+
<SfDropDownList TValue="string" TItem="Country" Placeholder="e.g. Australia" DataSource="@Countries">
7+
<DropDownListFieldSettings Text="Name" Value="Code"></DropDownListFieldSettings>
8+
</SfDropDownList>
9+
10+
@code {
11+
12+
public class Country
13+
{
14+
public string Name { get; set; }
15+
16+
public string Code { get; set; }
17+
}
18+
19+
List<Country> Countries = new List<Country>
20+
{
21+
new Country() { Name = "Australia", Code = "AU" },
22+
new Country() { Name = "Bermuda", Code = "BM" },
23+
new Country() { Name = "Canada", Code = "CA" },
24+
new Country() { Name = "Cameroon", Code = "CM" },
25+
new Country() { Name = "Denmark", Code = "DK" },
26+
new Country() { Name = "France", Code = "FR" },
27+
new Country() { Name = "Finland", Code = "FI" },
28+
new Country() { Name = "Germany", Code = "DE" },
29+
new Country() { Name = "Greenland", Code = "GL" },
30+
new Country() { Name = "Hong Kong", Code = "HK" },
31+
new Country() { Name = "India", Code = "IN" },
32+
new Country() { Name = "Italy", Code = "IT" },
33+
new Country() { Name = "Japan", Code = "JP" },
34+
new Country() { Name = "Mexico", Code = "MX" },
35+
new Country() { Name = "Norway", Code = "NO" },
36+
new Country() { Name = "Poland", Code = "PL" },
37+
new Country() { Name = "Switzerland", Code = "CH" },
38+
new Country() { Name = "United Kingdom", Code = "GB" },
39+
new Country() { Name = "United States", Code = "US" },
40+
};
41+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@page "/BindRemoteData"
2+
3+
@using Syncfusion.Blazor.Data
4+
@using Syncfusion.Blazor.DropDowns
5+
<SourceRoute></SourceRoute>
6+
7+
<SfDropDownList TValue="string" TItem="OrderDetails" Placeholder="Select a customer" Query="@Query">
8+
<SfDataManager Url="https://services.odata.org/V4/Northwind/Northwind.svc/Orders" Adaptor="Syncfusion.Blazor.Adaptors.ODataV4Adaptor" CrossDomain=true></SfDataManager>
9+
<DropDownListFieldSettings Text="CustomerID" Value="OrderID"></DropDownListFieldSettings>
10+
</SfDropDownList>
11+
12+
@code {
13+
public Query Query = new Query().Select(new List<string> { "CustomerID", "OrderID" }).Take(6).RequiresCount();
14+
15+
public class OrderDetails
16+
{
17+
public int? OrderID { get; set; }
18+
public string CustomerID { get; set; }
19+
public int? EmployeeID { get; set; }
20+
public double? Freight { get; set; }
21+
public string ShipCity { get; set; }
22+
public bool Verified { get; set; }
23+
public DateTime? OrderDate { get; set; }
24+
public string ShipName { get; set; }
25+
public string ShipCountry { get; set; }
26+
public DateTime? ShippedDate { get; set; }
27+
public string ShipAddress { get; set; }
28+
}
29+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@page "/BindingDynamicObject"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
@using System.Dynamic
5+
<SourceRoute></SourceRoute>
6+
7+
<SfDropDownList TValue="string" TItem="DynamicDictionary" Placeholder="Select a name" DataSource="@Orders">
8+
<DropDownListFieldSettings Text="CustomerName" Value="CustomerName"></DropDownListFieldSettings>
9+
</SfDropDownList>
10+
11+
@code {
12+
public List<DynamicDictionary> Orders = new List<DynamicDictionary>() { };
13+
protected override void OnInitialized()
14+
{
15+
Orders = Enumerable.Range(1, 15).Select((x) =>
16+
{
17+
dynamic d = new DynamicDictionary();
18+
d.OrderID = 1000 + x;
19+
d.CustomerName = (new string[] { "Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Anne", "Nige", "Fuller", "Dodsworth", "Leverling", "Callahan", "Suyama", "Davolio" }[x - 1]);
20+
return d;
21+
}).Cast<DynamicDictionary>().ToList<DynamicDictionary>();
22+
}
23+
public class DynamicDictionary : System.Dynamic.DynamicObject
24+
{
25+
Dictionary<string, object> dictionary = new Dictionary<string, object>();
26+
public override bool TryGetMember(GetMemberBinder binder, out object result)
27+
{
28+
string name = binder.Name;
29+
return dictionary.TryGetValue(name, out result);
30+
}
31+
public override bool TrySetMember(SetMemberBinder binder, object value)
32+
{
33+
dictionary[binder.Name] = value;
34+
return true;
35+
}
36+
//The GetDynamicMemberNames method of DynamicObject class must be overridden and return the property names to perform data operation and editing while using DynamicObject.
37+
public override System.Collections.Generic.IEnumerable<string> GetDynamicMemberNames()
38+
{
39+
return this.dictionary?.Keys;
40+
}
41+
}
42+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@page "/BindingExpandoObject"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
@using System.Dynamic
5+
<SourceRoute></SourceRoute>
6+
7+
<SfDropDownList TItem="ExpandoObject" TValue="string" PopupHeight="230px" Placeholder="Select a vehicle" DataSource="@VehicleData">
8+
<DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>
9+
</SfDropDownList>
10+
11+
@code {
12+
public List<ExpandoObject> VehicleData { get; set; } = new List<ExpandoObject>();
13+
protected override void OnInitialized()
14+
{
15+
VehicleData = Enumerable.Range(1, 15).Select((x) =>
16+
{
17+
dynamic d = new ExpandoObject();
18+
d.ID = (1000 + x).ToString();
19+
d.Text = (new string[] { "Hennessey Venom", "Bugatti Chiron", "Bugatti Veyron Super Sport", "SSC Ultimate Aero", "Koenigsegg CCR", "McLaren F1", "Aston Martin One- 77", "Jaguar XJ220", "McLaren P1", "Ferrari LaFerrari", "Mahindra Jaguar", "Hyundai Toyota", "Jeep Volkswagen", "Tata Maruti Suzuki", "Audi Mercedes Benz" }[x - 1]);
20+
return d;
21+
}).Cast<ExpandoObject>().ToList<ExpandoObject>();
22+
}
23+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@page "/BindingObservableCollection"
2+
3+
@using Syncfusion.Blazor.DropDowns
4+
@using System.Collections.ObjectModel;
5+
<SourceRoute></SourceRoute>
6+
7+
<SfDropDownList TValue="string" TItem="Colors" PopupHeight="230px" Placeholder="Select a color" DataSource="@ColorsData">
8+
<DropDownListFieldSettings Text="Color" Value="Code"></DropDownListFieldSettings>
9+
</SfDropDownList>
10+
11+
@code {
12+
public class Colors
13+
{
14+
public string Code { get; set; }
15+
public string Color { get; set; }
16+
}
17+
private ObservableCollection<Colors> ColorsData = new ObservableCollection<Colors>()
18+
{
19+
new Colors() { Color = "Chocolate", Code = "#75523C" },
20+
new Colors() { Color = "CadetBlue", Code = "#3B8289" },
21+
new Colors() { Color = "DarkOrange", Code = "#FF843D" },
22+
new Colors() { Color = "DarkRed", Code = "#CA3832"},
23+
new Colors() { Color = "Fuchsia", Code = "#D44FA3" },
24+
new Colors() { Color = "HotPink", Code = "#F23F82" },
25+
new Colors() { Color = "Indigo", Code = "#2F5D81" },
26+
new Colors() { Color = "LimeGreen", Code = "#4CD242" },
27+
new Colors() { Color = "OrangeRed", Code = "#FE2A00" },
28+
new Colors() { Color = "Tomato", Code = "#FF745C" },
29+
new Colors() { Color = "Brown", Code = "#A52A2A" },
30+
new Colors() { Color = "Maroon", Code = "#800000" },
31+
new Colors() { Color = "Green", Code = "#008000" },
32+
new Colors() { Color = "Pink", Code = "#FFC0CB" },
33+
new Colors() { Color = "Purple", Code = "#800080" }
34+
};
35+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@page "/EnumDataBinding"
2+
3+
@using Syncfusion.Blazor.DropDowns;
4+
<SourceRoute></SourceRoute>
5+
6+
<SfDropDownList TValue="Values" TItem="string" Placeholder="e.g. Australia" DataSource="@EnumValues" @bind-Value="@ddlVal">
7+
</SfDropDownList>
8+
9+
@code {
10+
11+
public string[] EnumValues = Enum.GetNames(typeof(Values));
12+
public Values ddlVal { get; set; } = Values.Canada;
13+
14+
public enum Values
15+
{
16+
Australia,
17+
Bermuda,
18+
Canada,
19+
Denmark,
20+
India,
21+
US
22+
23+
}
24+
}

0 commit comments

Comments
 (0)