FlexGrid
Tree View
This sample shows how to use FlexGrid to display a tree view.
Features
Header
Size
.vs
config
applicationhost.config
86,118
MvcExplorer
v14
App_Data
C1NWind.mdf
17,825,792
C1NWind_log.ldf
2,883,584
App_GlobalResources
Accordion.designer.cs
3,618
Accordion.ja.designer.cs
0
Accordion.ja.resx
6,423
Accordion.resx
6,137
AutoComplete.designer.cs
7,884
AutoComplete.ja.designer.cs
0
AutoComplete.ja.resx
7,974
0
Description
This sample shows how to use FlexGrid to display a tree view.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | using System.Web.Mvc; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { public ActionResult TreeView() { var list = MvcExplorer.Models.Folder.Create(Server.MapPath( "~" )).Children; return View(list); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | @using C1.Web.Mvc.Grid @model IEnumerable< ITreeItem > @section Styles{ < style > .custom-flex-grid { height: 400px; background-color: white; box-shadow: 4px 4px 10px 0px rgba(50, 50, 50, 0.75); margin-bottom: 12px; } .custom-flex-grid .wj-cell { background-color: #fff; border: none; font-size: 10pt; } .custom-flex-grid .wj-state-selected { background: #000; color: #fff; } .custom-flex-grid .wj-state-multi-selected { background: #222; color: #fff; } </ style > } < label > @Html .Raw(Resources.FlexGrid.TreeView_Text0)</ label > @ (Html.C1().FlexGrid().Id( "grid" ).CssClass( "custom-flex-grid" ).Width(500) .Bind(Model) .ChildItemsPath( "Children" ) .IsReadOnly( true ) .AutoGenerateColumns( false ) .Columns(columns => { columns.Add().Binding( "Header" ).Width( "*" ); columns.Add().Binding( "Size" ).Width( "80" ).Align( "center" ); }) .AllowResizing(AllowResizing.None) .HeadersVisibility(HeadersVisibility.None) .SelectionMode(SelectionMode.ListBox) ) @section Scripts{ <script> c1.documentReady( function () { wijmo.Control.getControl( "#grid" ).rows.defaultSize = 25; }); </script> } @section Description { @Html .Raw(Resources.FlexGrid.TreeView_Text1) } |