Skip to content

Commit 50d9ca7

Browse files
config(EJ2-000): Modified Tree Grid Samples
1 parent de9b957 commit 50d9ca7

File tree

3 files changed

+97
-22
lines changed

3 files changed

+97
-22
lines changed

ej2-blazor-samples/Pages/Grids/SampleList.cs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,11 @@ internal partial class SampleConfig
1919
},
2020
new Sample
2121
{
22-
Name = "Filtering",
22+
Name = "Sorting",
2323
Category = "TreeGrid",
2424
Directory = "Grids/TreeGrid",
25-
Url = "TreeGrid/DefaultFiltering",
26-
FileName = "DefaultFiltering.razor",
27-
Type = SampleType.New,
28-
},
29-
new Sample
30-
{
31-
Name = "Inline Editing",
32-
Category = "TreeGrid",
33-
Directory = "Grids/TreeGrid",
34-
Url = "TreeGrid/Editing",
35-
FileName = "Editing.razor",
36-
Type = SampleType.New,
37-
},
38-
new Sample
39-
{
40-
Name = "Checkbox Column",
41-
Category = "TreeGrid",
42-
Directory = "Grids/TreeGrid",
43-
Url = "TreeGrid/CheckboxColumn",
44-
FileName = "CheckboxColumn.razor",
25+
Url = "TreeGrid/Sorting",
26+
FileName = "Sorting.razor",
4527
Type = SampleType.New,
4628
}
4729
};

ej2-blazor-samples/Pages/Grids/TreeData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ public static List<SelfReferenceData> GetTree()
869869
if (tree.Count == 0)
870870
{
871871
int root = -1;
872-
for (var t = 1; t <= 15; t++)
872+
for (var t = 1; t <= 2; t++)
873873
{
874874
Random ran = new Random();
875875
string math = (ran.Next() % 3) == 0 ? "High" : (ran.Next() % 2) == 0 ? "Release Breaker" : "Critical";
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
@page "/TreeGrid/Sorting"
2+
3+
@using Syncfusion.EJ2.RazorComponents.TreeGrid
4+
@using Syncfusion.EJ2.RazorComponents.Grids
5+
@using Syncfusion.EJ2.RazorComponents.Data
6+
@using Syncfusion.EJ2.RazorComponents
7+
8+
@*Hidden:Lines*@
9+
@using ej2_blazor_samples
10+
@using ej2_blazor_treedata
11+
@{
12+
SampleBrowser.CurrentSampleName = "Filtering";
13+
SampleBrowser.CurrentControlName = "TreeGrid";
14+
SampleBrowser.CurrentControlCategory = "TreeGrid";
15+
SampleBrowser.CurrentControl = SampleBrowser.Config.TreeGrid;
16+
SampleBrowser.ActionDescription = new string[] {
17+
@"<p>
18+
This sample demonstrates the default filterbar in TreeGrid.
19+
In this sample, type the value in the filterbar and press enter to filter particular column. The filtering is based on hierarchy mode.
20+
</p>"
21+
};
22+
SampleBrowser.Description = new string[] {
23+
@"<p>
24+
The filtering feature enables the user to view the reduced amount of records based on filter criteria. It can be enabled
25+
by setting <code>
26+
allowFiltering
27+
</code> property as true. A filter bar row will be rendered next to header which allows the end-users to filter
28+
data by entering text within its cells.
29+
</p>
30+
<p>Filterbar uses two modes which specifies how to start filtering. They are,</p>
31+
<ul>
32+
<li><code>OnEnter</code> - Enabled by default, filter will be initiated after pressing <code>Enter</code> key.</li>
33+
<li>
34+
<code>Immediate</code> - Filter will start after user ends typing. This uses a time delay of <i>1500ms</i> to initiate
35+
filter after use stops typing. It can be overridden using the <code>
36+
filterSettings->immediateModeDelay
37+
</code> property.
38+
</li>
39+
</ul>
40+
<p>TreeGrid provides support for a set of filtering modes with <code>hierarchyMode</code> property. The below are the type of filter mode available in TreeGrid. </p>
41+
<ul>
42+
<li>
43+
<code>Parent</code> - This is the default filter hierarchy mode in TreeGrid.
44+
The filtered records are displayed with its parent records, if the filtered records not have any parent record then the filtered record only displayed.
45+
</li>
46+
<li><code>Child</code> - The filtered records are displayed with its child record, if the filtered records do not have any child record then only the filtered records are displayed.</li>
47+
<li>
48+
<code>Both</code> - The filtered records are displayed with its both parent and child record.
49+
If the filtered records do not have any parent and child record then only the filtered records are displayed.
50+
</li>
51+
<li><code>None</code> - Only the filtered records are displayed.</li>
52+
</ul>
53+
<p>In this demo, you can type the value in the filterbar and press enter to filter particular column or select the value from filterbar template of Duration column.</p>
54+
<br>
55+
56+
<p>
57+
More information on the data binding can be found in this documentation section.
58+
</p>"
59+
};
60+
}
61+
@*End:Hidden*@
62+
63+
64+
<div class="col-lg-12 control-section">
65+
<div class="content-wrapper">
66+
<div class="row">
67+
68+
<EjsTreeGrid ID="TreeGrid" DataSource="@treedata" IdMapping="TaskID" ParentIdMapping="ParentItem" TreeColumnIndex="1" Height="480" AllowSorting="true" AllowPaging="true">
69+
<TreeGridPageSettings PageSize="1"></TreeGridPageSettings>
70+
<TreeGridColumns>
71+
<TreeGridColumn Field="TaskID" HeaderText="Task ID" Width="80" TextAlign="@Syncfusion.EJ2.RazorComponents.Grids.TextAlign.Right"></TreeGridColumn>
72+
<TreeGridColumn Field="TaskName" HeaderText="Task Name" Width="160"></TreeGridColumn>
73+
<TreeGridColumn Field="Duration" HeaderText="Duration" Width="100" TextAlign="@Syncfusion.EJ2.RazorComponents.Grids.TextAlign.Right"></TreeGridColumn>
74+
<TreeGridColumn Field="Progress" HeaderText="Progress" Width="100" TextAlign="@Syncfusion.EJ2.RazorComponents.Grids.TextAlign.Right"></TreeGridColumn>
75+
<TreeGridColumn Field="Priority" HeaderText="Priority" Width="80"></TreeGridColumn>
76+
<TreeGridColumn Field="Duration" HeaderText="Duration" Width="80"></TreeGridColumn>
77+
</TreeGridColumns>
78+
</EjsTreeGrid>
79+
</div>
80+
</div>
81+
</div>
82+
83+
@code{
84+
85+
EjsTreeGrid treeGrid;
86+
87+
public List<SelfReferenceData> treedata { get; set; }
88+
89+
protected override void OnInit()
90+
{
91+
this.treedata = SelfReferenceData.GetTree().ToList();
92+
}
93+
}

0 commit comments

Comments
 (0)