File tree Expand file tree Collapse file tree 5 files changed +24
-13
lines changed
Grid-AdaptiveLayout/Grid-AdaptiveLayout Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 99
1010 <ItemGroup >
1111 <PackageReference Include =" Syncfusion.Blazor.Grid" Version =" 20.4.0.49" />
12+ <PackageReference Include =" Syncfusion.Blazor.Themes" Version =" 20.4.0.49" />
1213 </ItemGroup >
1314
1415</Project >
Original file line number Diff line number Diff line change 1- @page " /counter "
1+ @page " /adaptiveuiWithMediaQuery "
22
33@using Syncfusion .Blazor
44@using Syncfusion .Blazor .Grids
55
6+ <p >DataGrid Adaptive UI layout using Media Query Component</p >
7+
68<div style =" position :relative ; min-height : 500px ;" >
79 <SfMediaQuery @bind-ActiveBreakPoint =" activeBreakpoint" />
810 @if (activeBreakpoint == " Small" )
2022 <GridFilterSettings Type =" @FilterType.Excel" />
2123 <GridEditSettings AllowAdding =" true" AllowEditing =" true" AllowDeleting =" true" Mode =" EditMode.Dialog" />
2224 <GridColumns >
23- <GridColumn Field =@nameof(Order.OrderID) HeaderText =" Order ID" IsPrimaryKey =" true" Width =" 80" ValidationRules =" @(new ValidationRules{ Required= true })" ></ GridColumn >
24- <GridColumn Field =@nameof(Order.CustomerID) HeaderText =" Customer Name" Width =" 120" ></ GridColumn >
25- <GridColumn Field =@nameof(Order.OrderDate) HeaderText =" Order Date" Format =" d" Type =" ColumnType.Date" Width =" 130" ></ GridColumn >
26- <GridColumn Field =@nameof(Order.Freight) HeaderText =" Freight" Format =" C2" Width =" 120" ></ GridColumn >
25+ <GridColumn Field =@nameof(Order.OrderID) HeaderText =" Order ID" IsPrimaryKey =" true" Width =" 80" ValidationRules =" @(new ValidationRules{ Required= true })" / >
26+ <GridColumn Field =@nameof(Order.CustomerID) HeaderText =" Customer Name" Width =" 120" / >
27+ <GridColumn Field =@nameof(Order.OrderDate) HeaderText =" Order Date" Format =" d" Type =" ColumnType.Date" Width =" 130" / >
28+ <GridColumn Field =@nameof(Order.Freight) HeaderText =" Freight" Format =" C2" Width =" 120" / >
2729 </GridColumns >
2830 </SfGrid >
2931</div >
Original file line number Diff line number Diff line change 22
33@using Syncfusion .Blazor .Grids
44
5+ <p >DataGrid Adaptive UI layout using AdaptiveUIMode property</p >
6+
57<div style =" position :relative ; min-height : 500px ;" >
68 <SfGrid DataSource =" @Orders" AllowSorting =" true" AllowFiltering =" true" EnableAdaptiveUI =" true"
79 AdaptiveUIMode =" AdaptiveMode.Mobile" Height =" 100%" Width =" 100%" AllowPaging =" true"
1820</div >
1921
2022@code {
21- public List <Order > Orders { get ; set ; }
23+ public List <Order >? Orders { get ; set ; }
2224
2325 protected override void OnInitialized ()
2426 {
3436 public class Order
3537 {
3638 public int ? OrderID { get ; set ; }
37- public string CustomerID { get ; set ; }
39+ public string ? CustomerID { get ; set ; }
3840 public DateTime ? OrderDate { get ; set ; }
3941 public double ? Freight { get ; set ; }
4042 }
Original file line number Diff line number Diff line change 1111 <link rel =" stylesheet" href =" css/bootstrap/bootstrap.min.css" />
1212 <link href =" css/site.css" rel =" stylesheet" />
1313 <link href =" Grid-AdaptiveLayout.styles.css" rel =" stylesheet" />
14- <link href =" https://cdn.syncfusion.com/blazor/20.4.48/styles/fluent .css" rel =" stylesheet" />
15- <script src =" https://cdn.syncfusion.com/blazor/20.4.48 /syncfusion-blazor.min.js" type =" text/javascript" ></script >
14+ <link href =" _content/Syncfusion.Blazor.Themes/bootstrap5 .css" rel =" stylesheet" />
15+ <script src =" _content/Syncfusion.Blazor.Core/scripts /syncfusion-blazor.min.js" type =" text/javascript" ></script >
1616 <component type =" typeof(HeadOutlet)" render-mode =" ServerPrerendered" />
1717</head >
1818<body >
Original file line number Diff line number Diff line change 1111 <nav class =" flex-column" >
1212 <div class =" nav-item px-3" >
1313 <NavLink class =" nav-link" href =" " Match =" NavLinkMatch.All" >
14- <span class = " oi oi-home " aria-hidden =" true" ></span > Home
14+ <span aria-hidden =" true" ></span > DataGrid Adaptive UI layout
1515 </NavLink >
1616 </div >
1717 <div class =" nav-item px-3" >
18- <NavLink class =" nav-link" href =" counter " >
19- <span class = " oi oi-plus " aria-hidden =" true" ></span > AdaptiveUI with SfMediaQuery
18+ <NavLink class =" nav-link" href =" adaptiveuiWithMediaQuery " >
19+ <span aria-hidden =" true" ></span > DataGrid Adaptive UI using Media Query Component
2020 </NavLink >
2121 </div >
2222 <div class =" nav-item px-3" >
2323 <NavLink class =" nav-link" href =" fetchdata" >
24- <span class = " oi oi-list-rich " aria-hidden =" true" ></span > Fetch data
24+ <span aria-hidden =" true" ></span > Fetch data
2525 </NavLink >
2626 </div >
2727 </nav >
3737 collapseNavMenu = ! collapseNavMenu ;
3838 }
3939}
40+
41+ <style >
42+ .nav-item.px-3 .nav-link {
43+ line-height : 1rem ;
44+ }
45+ </style >
You can’t perform that action at this time.
0 commit comments