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