12345678910111213141516171819202122232425262728293031 |
- using System;
- using System.Threading;
- using InABox.Core;
- using InABox.DynamicGrid;
- using NPOI.SS.Formula;
- namespace PRSDesktop;
- public class LocalityGrid : DynamicDataGrid<Locality>
- {
- public Guid StateId { get; set; }
- protected override void DoReconfigure(DynamicGridOptions options)
- {
- base.DoReconfigure(options);
- options.MultiSelect = true;
- }
- protected override void Reload(Filters<Locality> criteria, Columns<Locality> columns, ref SortOrder<Locality>? sort, CancellationToken token, Action<CoreTable?, Exception?> action)
- {
- criteria.Add(new Filter<Locality>(x => x.State.ID).IsEqualTo(StateId));
- base.Reload(criteria, columns, ref sort, token, action);
- }
-
- public override Locality CreateItem()
- {
- var result = base.CreateItem();
- result.State.ID = StateId;
- return result;
- }
- }
|