|
| 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