|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Controls;
|
|
|
|
+using System.Windows.Input;
|
|
using InABox.Core;
|
|
using InABox.Core;
|
|
using InABox.Wpf;
|
|
using InABox.Wpf;
|
|
|
|
|
|
@@ -106,33 +107,42 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
_grid.SelectedRows = _grid.Data.Rows.Where(r => r.Get<Guid>("ID").Equals(ID)).ToArray();
|
|
_grid.SelectedRows = _grid.Data.Rows.Where(r => r.Get<Guid>("ID").Equals(ID)).ToArray();
|
|
|
|
|
|
|
|
+ _grid.OnDoubleClick += Grid_OnDoubleClick;
|
|
|
|
+
|
|
//Left = screen.DeviceBounds.Left + ((screen.DeviceBounds.Width - Width) / 2.0F);
|
|
//Left = screen.DeviceBounds.Left + ((screen.DeviceBounds.Width - Width) / 2.0F);
|
|
//Top = screen.DeviceBounds.Top + ((screen.DeviceBounds.Height - Height) / 2.0F);
|
|
//Top = screen.DeviceBounds.Top + ((screen.DeviceBounds.Height - Height) / 2.0F);
|
|
//WpfScreen.CenterWindowOnScreen(this);
|
|
//WpfScreen.CenterWindowOnScreen(this);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void Grid_OnDoubleClick(object sender, System.ComponentModel.HandledEventArgs args)
|
|
|
|
+ {
|
|
|
|
+ if (_grid.SelectedRows.Any())
|
|
|
|
+ CheckSelectedAndClose();
|
|
|
|
+ }
|
|
|
|
|
|
private void OKButton_Click(object sender, RoutedEventArgs e)
|
|
private void OKButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
if (_grid.SelectedRows.Any())
|
|
if (_grid.SelectedRows.Any())
|
|
- {
|
|
|
|
- ID = _grid.SelectedRows.First().Get<Guid>("ID");
|
|
|
|
|
|
+ CheckSelectedAndClose();
|
|
|
|
+ else
|
|
|
|
+ MessageBox.Show("Please select an Item first");
|
|
|
|
|
|
- //AsLookup = _grid.SelectedRows.First().Get<String>("AsLookup");
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- foreach (var key in OtherValues.Keys.ToArray())
|
|
|
|
- {
|
|
|
|
- var comps = key.Split(new[] { "->" }, StringSplitOptions.None);
|
|
|
|
- OtherValues[key] = _grid.SelectedRows.First().Get<object>(comps.First());
|
|
|
|
- }
|
|
|
|
|
|
+ private void CheckSelectedAndClose()
|
|
|
|
+ {
|
|
|
|
+ ID = _grid.SelectedRows.First().Get<Guid>("ID");
|
|
|
|
|
|
- DialogResult = true;
|
|
|
|
- Close();
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ //AsLookup = _grid.SelectedRows.First().Get<String>("AsLookup");
|
|
|
|
+
|
|
|
|
+ foreach (var key in OtherValues.Keys.ToArray())
|
|
{
|
|
{
|
|
- MessageBox.Show("Please select an Item first");
|
|
|
|
|
|
+ var comps = key.Split(new[] { "->" }, StringSplitOptions.None);
|
|
|
|
+ OtherValues[key] = _grid.SelectedRows.First().Get<object>(comps.First());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ DialogResult = true;
|
|
|
|
+ Close();
|
|
}
|
|
}
|
|
|
|
|
|
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
|
private void CancelButton_Click(object sender, RoutedEventArgs e)
|