V6ProjectGrid.cs 961 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Windows.Media.Imaging;
  3. using InABox.Core;
  4. using InABox.DynamicGrid;
  5. using InABox.WPF;
  6. using PRSDesktop.Integrations.V6;
  7. namespace PRSDesktop.Integrations.V6.Grids;
  8. public class V6ProjectGrid : DynamicItemsListGrid<V6Project>
  9. {
  10. public bool ShowPrices { get; set; }
  11. public override DynamicGridColumns GenerateColumns()
  12. {
  13. var result = new DynamicGridColumns()
  14. .AddFluent<V6Project>(x => x.Number, 60, "No.", null, Alignment.MiddleCenter)
  15. .AddFluent<V6Project>(x => x.Title, 0, "Title", null, Alignment.MiddleLeft);
  16. if (ShowPrices)
  17. result.AddFluent<V6Project>(x=>x.SellPrice,100, "Ex Tax", "F2", Alignment.MiddleCenter);
  18. return result;
  19. }
  20. protected override void DoReconfigure(DynamicGridOptions options)
  21. {
  22. base.DoReconfigure(options);
  23. options.FilterRows = true;
  24. options.HideDatabaseFilters = true;
  25. }
  26. }