|
@@ -21,13 +21,16 @@ public class ProblemsDockGrid : DynamicDataGrid<Problems>
|
|
base.Init();
|
|
base.Init();
|
|
HiddenColumns.Add(x=>x.Problem.Notes);
|
|
HiddenColumns.Add(x=>x.Problem.Notes);
|
|
HiddenColumns.Add(x=>x.Problem.AssignedTo.Code);
|
|
HiddenColumns.Add(x=>x.Problem.AssignedTo.Code);
|
|
|
|
+
|
|
|
|
+
|
|
ActionColumns.Add(new DynamicImageColumn(TypeImage)
|
|
ActionColumns.Add(new DynamicImageColumn(TypeImage)
|
|
{
|
|
{
|
|
Position = DynamicActionColumnPosition.Start,
|
|
Position = DynamicActionColumnPosition.Start,
|
|
Filters = IMAGES.Keys.Select(x=>x.Name.Split('.').Last()).ToArray(),
|
|
Filters = IMAGES.Keys.Select(x=>x.Name.Split('.').Last()).ToArray(),
|
|
- FilterRecord = TypeFilter
|
|
|
|
-
|
|
|
|
|
|
+ GetFilterExpression = (col) => TypeExpression(col),
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+
|
|
ActionColumns.Add(new DynamicTextColumn(GetLastNote) { Position = DynamicActionColumnPosition.End, Width = 0, HeaderText = "Issues" });
|
|
ActionColumns.Add(new DynamicTextColumn(GetLastNote) { Position = DynamicActionColumnPosition.End, Width = 0, HeaderText = "Issues" });
|
|
ActionColumns.Add(new DynamicTextColumn(GetAssignedTo) { Position = DynamicActionColumnPosition.End, Width = 100, HeaderText="Assigned To", Alignment = Alignment.MiddleCenter});
|
|
ActionColumns.Add(new DynamicTextColumn(GetAssignedTo) { Position = DynamicActionColumnPosition.End, Width = 100, HeaderText="Assigned To", Alignment = Alignment.MiddleCenter});
|
|
ActionColumns.Add(new DynamicMenuColumn(ProblemMenu) { Position = DynamicActionColumnPosition.End });
|
|
ActionColumns.Add(new DynamicMenuColumn(ProblemMenu) { Position = DynamicActionColumnPosition.End });
|
|
@@ -37,7 +40,12 @@ public class ProblemsDockGrid : DynamicDataGrid<Problems>
|
|
AddButton("Mark Resolved", PRSDesktop.Resources.delete.AsBitmapImage(), MarkResolved,
|
|
AddButton("Mark Resolved", PRSDesktop.Resources.delete.AsBitmapImage(), MarkResolved,
|
|
position: DynamicGridButtonPosition.Right);
|
|
position: DynamicGridButtonPosition.Right);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ private string TypeExpression(DynamicActionColumn column)
|
|
|
|
+ {
|
|
|
|
+ return column.CreateFilterExpression("Type") ?? "";
|
|
|
|
+ }
|
|
|
|
+
|
|
private bool TypeFilter(CoreRow row, string[] filter)
|
|
private bool TypeFilter(CoreRow row, string[] filter)
|
|
{
|
|
{
|
|
string typename = row.Get<Problems, string>(x => x.Type);
|
|
string typename = row.Get<Problems, string>(x => x.Type);
|
|
@@ -85,13 +93,18 @@ public class ProblemsDockGrid : DynamicDataGrid<Problems>
|
|
? IMAGES[_key]
|
|
? IMAGES[_key]
|
|
: null;
|
|
: null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private string? TypeText(CoreRow? row)
|
|
|
|
+ {
|
|
|
|
+ return row?.Get<Problems, string>(x => x.Type) ?? "";
|
|
|
|
+ }
|
|
|
|
|
|
private void ProblemMenu(DynamicMenuColumn menu, CoreRow? row)
|
|
private void ProblemMenu(DynamicMenuColumn menu, CoreRow? row)
|
|
{
|
|
{
|
|
menu.AddItem("Add Note", null, AddNote);
|
|
menu.AddItem("Add Note", null, AddNote);
|
|
menu.AddItem("Assign To...", null, AssignTo);
|
|
menu.AddItem("Assign To...", null, AssignTo);
|
|
menu.AddSeparator();
|
|
menu.AddSeparator();
|
|
- menu.AddItem("Edit Item", null, EitItem);
|
|
|
|
|
|
+ menu.AddItem("Edit Item", null, EditItem);
|
|
menu.AddSeparator();
|
|
menu.AddSeparator();
|
|
menu.AddItem("Mark as Resolved", null, MarkResolved);
|
|
menu.AddItem("Mark as Resolved", null, MarkResolved);
|
|
}
|
|
}
|
|
@@ -266,10 +279,10 @@ public class ProblemsDockGrid : DynamicDataGrid<Problems>
|
|
base.DoDoubleClick(sender, args);
|
|
base.DoDoubleClick(sender, args);
|
|
if (args.Row == null)
|
|
if (args.Row == null)
|
|
return;
|
|
return;
|
|
- EitItem(args.Row);
|
|
|
|
|
|
+ EditItem(args.Row);
|
|
}
|
|
}
|
|
|
|
|
|
- private void EitItem(CoreRow? row)
|
|
|
|
|
|
+ private void EditItem(CoreRow? row)
|
|
{
|
|
{
|
|
var _type = GetType(row);
|
|
var _type = GetType(row);
|
|
if (_type == null)
|
|
if (_type == null)
|
|
@@ -278,7 +291,7 @@ public class ProblemsDockGrid : DynamicDataGrid<Problems>
|
|
if (_item == null)
|
|
if (_item == null)
|
|
return;
|
|
return;
|
|
var _grid = DynamicGridUtils.CreateDynamicGrid(typeof(DynamicDataGrid<>), _type);
|
|
var _grid = DynamicGridUtils.CreateDynamicGrid(typeof(DynamicDataGrid<>), _type);
|
|
- if (_grid.EditItems([ _item ]))
|
|
|
|
|
|
+ if (_grid.EditItems([ _item ], null, false, this))
|
|
Refresh(false,true);
|
|
Refresh(false,true);
|
|
}
|
|
}
|
|
}
|
|
}
|