RoleActivityGrid.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using Comal.Classes;
  2. using InABox.Core;
  3. using InABox.DynamicGrid;
  4. namespace PRSDesktop;
  5. internal class RoleActivityGrid : DynamicManyToManyGrid<RoleActivity, Role>
  6. {
  7. public RoleActivityGrid()
  8. {
  9. //var dtc = new DynamicTickColumn<RoleActivity, bool>(x => x.Enabled, PRSDesktop.Resources.tick.AsBitmapImage(), PRSDesktop.Resources.tick.AsBitmapImage(), PRSDesktop.Resources.disabled.AsBitmapImage());
  10. //dtc.Action = EnableActivity;
  11. //ActionColumns.Add(dtc);
  12. }
  13. protected override void DoReconfigure(DynamicGridOptions options)
  14. {
  15. base.DoReconfigure(options);
  16. options.RecordCount = true;
  17. options.SelectColumns = true;
  18. options.AddRows = true;
  19. options.DeleteRows = true;
  20. options.MultiSelect = true;
  21. }
  22. //private bool EnableActivity(CoreRow arg)
  23. //{
  24. // var items = arg == null ? WorkingList.ToArray() : new RoleActivity[] { WorkingList[arg.Index] }; // .Where(x => x.ID.Equals(arg.Get<RoleActivity, Guid>(c => c.ID)));
  25. // foreach (var item in items)
  26. // item.Enabled = !item.Enabled;
  27. // return true;
  28. //}
  29. }