FlexGrid
FlexGrid
Disable Server Reading
This sample shows what the DisableServerRead property works for.
Features
FlexGrid without paging
ID
Start
End
Country
Product
Color
Amount
Amount2
Discount
Active
Url
1
1/25/2025
1/25/2025
German
Gadget
Green
581.61
1,030.17
0.14
https://en.wikipedia.org/wiki/Tourism_in_German
2
2/25/2025
2/25/2025
Italy
Gadget
Green
-4,673.75
3,499.71
0.13
https://en.wikipedia.org/wiki/Tourism_in_Italy
0
loading...
Paging FlexGrid which PageSize is set to 10
ID
Start
End
Country
Product
Color
Amount
Amount2
Discount
Active
Url
1
1/25/2025
1/25/2025
German
Gadget
Green
581.61
1,030.17
0.14
https://en.wikipedia.org/wiki/Tourism_in_German
2
2/25/2025
2/25/2025
Italy
Gadget
Green
-4,673.75
3,499.71
0.13
https://en.wikipedia.org/wiki/Tourism_in_Italy
3
3/25/2025
3/25/2025
China
Gadget
Black
-2,265.49
4,535.49
0.20
https://en.wikipedia.org/wiki/Tourism_in_China
4
4/25/2025
4/25/2025
France
Widget
Green
3,964.40
432.90
0.21
https://en.wikipedia.org/wiki/Tourism_in_France
5
5/25/2025
5/25/2025
UK
Widget
Red
-1,744.99
3,355.18
0.12
https://en.wikipedia.org/wiki/Tourism_in_UK
6
6/25/2025
6/25/2025
France
Gadget
Red
4,276.37
1,106.71
0.23
https://en.wikipedia.org/wiki/Tourism_in_France
7
7/25/2025
7/25/2025
US
Widget
Green
-4,376.92
1,408.24
0.18
https://en.wikipedia.org/wiki/Tourism_in_US
8
8/25/2025
8/25/2025
Japan
Gadget
Black
1,996.52
3,077.04
0.21
https://en.wikipedia.org/wiki/Tourism_in_Japan
9
9/25/2025
9/25/2025
Korea
Widget
Red
-3,442.35
4,068.26
0.16
https://en.wikipedia.org/wiki/Tourism_in_Korea
10
10/25/2025
10/25/2025
US
Widget
Green
-2,973.96
4,568.15
0.01
https://en.wikipedia.org/wiki/Tourism_in_US
0
loading...
Settings
Description
This sample shows what the DisableServerRead property works for.
When it is set to True, all the items will be transferred to the client side. Sorting, paging or filtering will be done in the client side.
And the text like "Loading..." is not shown for loading the data when the scrollbar scrolls.
Otherwise, sorting, paging or filtering will be done in server side. And sometimes the "Loading..." text will be shown.
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 | using System.Collections.Generic; using C1.Web.Mvc; using Microsoft.AspNetCore.Mvc; using MvcExplorer.Models; using C1.Web.Mvc.Serialization; using Microsoft.AspNetCore.Http; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { private readonly ControlOptions _disableServerReadSetting = new ControlOptions { Options = new OptionDictionary { { "Disable Server Read" , new OptionItem{Values = new List< string > { "True" , "False" },CurrentValue = "True" }} } }; public ActionResult DisableServerRead(IFormCollection collection) { _disableServerReadSetting.LoadPostData(collection); ViewBag.DemoOptions = _disableServerReadSetting; return View(); } public ActionResult DisableServerRead_Bind([C1JsonRequest] CollectionViewRequest<Sale> requestData) { return this .C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(500))); } } } |
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 | @ { ControlOptions optionsModel = ViewBag.DemoOptions; ViewBag.DemoSettings = true ; } < h4 > @Html .Raw(FlexGridRes.DisableServerRead_Text0)</ h4 > < c1-flex-grid id = "dsrFlexGrid" auto-generate-columns = "true" class = "grid" is-read-only = "true" > < c1-flex-grid-filter ></ c1-flex-grid-filter > < c1-items-source disable-server-read = "@(Convert.ToBoolean(optionsModel.Options[" Disable Server Read "].CurrentValue))" initial-items-count = "10" read-action-url = "@Url.Action(" DisableServerRead_Bind ")" ></ c1-items-source > </ c1-flex-grid > < br /> < br /> < h4 > @Html .Raw(FlexGridRes.DisableServerRead_Text1)</ h4 > < c1-flex-grid id = "dsrPagingGrid" auto-generate-columns = "true" height = "300px" style = "height:auto" class = "grid" is-read-only = "true" > < c1-flex-grid-filter ></ c1-flex-grid-filter > < c1-items-source disable-server-read = "@(Convert.ToBoolean(optionsModel.Options[" Disable Server Read "].CurrentValue))" page-size = "10" read-action-url = "@Url.Action(" DisableServerRead_Bind ")" ></ c1-items-source > </ c1-flex-grid > < c1-pager owner = "dsrPagingGrid" ></ c1-pager > @section Settings{ @await Html.PartialAsync( "_OptionsMenu" , optionsModel) } @section Description{ @Html .Raw(FlexGridRes.DisableServerRead_Text2) } |