GPSTrackerGrid.cs 933 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Threading;
  3. using Comal.Classes;
  4. using InABox.Core;
  5. using InABox.DynamicGrid;
  6. namespace PRSDesktop
  7. {
  8. internal class GPSTrackerGrid : DynamicDataGrid<GPSTracker>
  9. {
  10. public GPSTrackerGrid()
  11. {
  12. ActionColumns.Add(new DynamicMapColumn<GPSTracker>(this, x => x.Location));
  13. }
  14. protected override void DoReconfigure(DynamicGridOptions options)
  15. {
  16. base.DoReconfigure(options);
  17. options.RecordCount = true;
  18. options.SelectColumns = true;
  19. }
  20. protected override void Reload(
  21. Filters<GPSTracker> criteria, Columns<GPSTracker> columns, ref SortOrder<GPSTracker>? sort,
  22. CancellationToken token, Action<CoreTable?, Exception?> action)
  23. {
  24. sort = new SortOrder<GPSTracker>(x => x.DeviceID);
  25. base.Reload(criteria, columns, ref sort, token, action);
  26. }
  27. }
  28. }